Class: TileItem
- Inherits:
-
Object
- Object
- TileItem
- Defined in:
- lib/tile_item.rb
Constant Summary collapse
- DEFAULT_RENDER_PRIORITY =
0
Instance Attribute Summary collapse
-
#colour ⇒ Object
readonly
Returns the value of attribute colour.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#obj ⇒ Object
readonly
Returns the value of attribute obj.
-
#render_priority ⇒ Object
readonly
Returns the value of attribute render_priority.
-
#render_symbol ⇒ Object
readonly
Returns the value of attribute render_symbol.
Instance Method Summary collapse
-
#initialize(obj, render_symbol:, id: object_id, render_priority: DEFAULT_RENDER_PRIORITY) ⇒ TileItem
constructor
A new instance of TileItem.
- #to_h ⇒ Object
Constructor Details
#initialize(obj, render_symbol:, id: object_id, render_priority: DEFAULT_RENDER_PRIORITY) ⇒ TileItem
Returns a new instance of TileItem.
7 8 9 10 11 12 |
# File 'lib/tile_item.rb', line 7 def initialize(obj, render_symbol:, id: object_id, render_priority: DEFAULT_RENDER_PRIORITY) @obj = obj @id = id @render_symbol = render_symbol @render_priority = render_priority end |
Instance Attribute Details
#colour ⇒ Object (readonly)
Returns the value of attribute colour.
5 6 7 |
# File 'lib/tile_item.rb', line 5 def colour @colour end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
5 6 7 |
# File 'lib/tile_item.rb', line 5 def id @id end |
#obj ⇒ Object (readonly)
Returns the value of attribute obj.
5 6 7 |
# File 'lib/tile_item.rb', line 5 def obj @obj end |
#render_priority ⇒ Object (readonly)
Returns the value of attribute render_priority.
5 6 7 |
# File 'lib/tile_item.rb', line 5 def render_priority @render_priority end |
#render_symbol ⇒ Object (readonly)
Returns the value of attribute render_symbol.
5 6 7 |
# File 'lib/tile_item.rb', line 5 def render_symbol @render_symbol end |
Instance Method Details
#to_h ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/tile_item.rb', line 14 def to_h { id: id, type: obj.class.name.downcase, render_symbol: render_symbol, render_priority: render_priority } end |