Class: Selector
- Extended by:
- Identifiable
- Includes:
- Identity, SelectorAcquire, SelectorQuery, SelectorRelinquish
- Defined in:
- tomes/components/selector/selector.rb
Overview
Note:
Stack-based functionality is experimental so it has been omitted. It can be added manually.
A mechanism for tracking two pieces of information at a time. For example, while dragging an item on screen a selector can track
both what the item is and the cursor's relative position to it.
Instance Attribute Summary collapse
-
#memory ⇒ Object
readonly
Returns the value of attribute memory.
-
#possession ⇒ Object
readonly
The convention is to use this attribute to represent “tangible” objects.
Attributes included from Identity
Instance Method Summary collapse
-
#info ⇒ Hash
A hash containing basic data about the selector.
-
#to_s ⇒ String
A one-line string of some basic data about the selector.
Methods included from Identifiable
id_counter, increment_id_counter, tag, tag=
Methods included from SelectorQuery
#blank?, #empty?, #has?, #knows?
Methods included from SelectorRelinquish
Methods included from SelectorAcquire
Methods included from Identity
Instance Attribute Details
#memory ⇒ Object
Returns the value of attribute memory.
43 |
# File 'tomes/components/selector/selector.rb', line 43 attr_reader :possession, :memory |
#possession ⇒ Object
The convention is to use this attribute to represent “tangible” objects.
43 44 45 |
# File 'tomes/components/selector/selector.rb', line 43 def possession @possession end |
Instance Method Details
#info ⇒ Hash
A hash containing basic data about the selector.
@note This method will change (probably drastically) in a future update.
48 49 50 51 52 53 54 55 |
# File 'tomes/components/selector/selector.rb', line 48 def info { self: self, id: id_tag, has: @possession, remembers: @memory } end |
#to_s ⇒ String
A one-line string of some basic data about the selector.
59 60 61 |
# File 'tomes/components/selector/selector.rb', line 59 def to_s '%<id>s - h: %<has>s | r: %<remembers>s | s: %<stack>s' % info end |