Class: A2UI::Surface
- Inherits:
-
Object
- Object
- A2UI::Surface
- Extended by:
- T::Sig
- Defined in:
- lib/a2ui/modules/surface.rb
Instance Attribute Summary collapse
-
#components ⇒ Object
readonly
Returns the value of attribute components.
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#root_id ⇒ Object
readonly
Returns the value of attribute root_id.
Instance Method Summary collapse
- #apply_data_updates(updates) ⇒ Object
- #get_data(path) ⇒ Object
-
#initialize(id) ⇒ Surface
constructor
A new instance of Surface.
- #set_components(root_id, components) ⇒ Object
- #to_json ⇒ Object
Constructor Details
Instance Attribute Details
#components ⇒ Object (readonly)
Returns the value of attribute components.
15 16 17 |
# File 'lib/a2ui/modules/surface.rb', line 15 def components @components end |
#data ⇒ Object (readonly)
Returns the value of attribute data.
18 19 20 |
# File 'lib/a2ui/modules/surface.rb', line 18 def data @data end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
9 10 11 |
# File 'lib/a2ui/modules/surface.rb', line 9 def id @id end |
#root_id ⇒ Object (readonly)
Returns the value of attribute root_id.
12 13 14 |
# File 'lib/a2ui/modules/surface.rb', line 12 def root_id @root_id end |
Instance Method Details
#apply_data_updates(updates) ⇒ Object
35 36 37 38 39 |
# File 'lib/a2ui/modules/surface.rb', line 35 def apply_data_updates(updates) updates.each do |update| @data[update.path] = entries_to_hash(update.entries) end end |
#get_data(path) ⇒ Object
42 43 44 |
# File 'lib/a2ui/modules/surface.rb', line 42 def get_data(path) @data[path] end |
#set_components(root_id, components) ⇒ Object
29 30 31 32 |
# File 'lib/a2ui/modules/surface.rb', line 29 def set_components(root_id, components) @root_id = root_id components.each { |c| @components[c.id] = c } end |
#to_json ⇒ Object
47 48 49 |
# File 'lib/a2ui/modules/surface.rb', line 47 def to_json @data.to_json end |