Class: Fiona7::Builder::BatchWidgetWriter::WidgetNode
- Inherits:
-
Object
- Object
- Fiona7::Builder::BatchWidgetWriter::WidgetNode
- Defined in:
- lib/fiona7/builder/batch_widget_writer.rb
Instance Attribute Summary collapse
-
#builder ⇒ Object
readonly
Returns the value of attribute builder.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#values ⇒ Object
readonly
Returns the value of attribute values.
Instance Method Summary collapse
- #dependencies ⇒ Object
- #eql?(other) ⇒ Boolean
- #hash ⇒ Object
-
#initialize(id, values, builder) ⇒ WidgetNode
constructor
A new instance of WidgetNode.
Constructor Details
#initialize(id, values, builder) ⇒ WidgetNode
Returns a new instance of WidgetNode.
40 41 42 |
# File 'lib/fiona7/builder/batch_widget_writer.rb', line 40 def initialize(id, values, builder) @id, @values, @builder = id, values, builder end |
Instance Attribute Details
#builder ⇒ Object (readonly)
Returns the value of attribute builder.
38 39 40 |
# File 'lib/fiona7/builder/batch_widget_writer.rb', line 38 def builder @builder end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
38 39 40 |
# File 'lib/fiona7/builder/batch_widget_writer.rb', line 38 def id @id end |
#values ⇒ Object (readonly)
Returns the value of attribute values.
38 39 40 |
# File 'lib/fiona7/builder/batch_widget_writer.rb', line 38 def values @values end |
Instance Method Details
#dependencies ⇒ Object
44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/fiona7/builder/batch_widget_writer.rb', line 44 def dependencies Set.new.tap do |dependencies| values.each do |attribute_name, (type, val)| if type == "widgetlist" if val.kind_of?(Array) dependencies.merge(val) elsif val.kind_of?(Hash) dependencies.merge((val["list"]||[]).map {|w| w["widget"] }) end end end end end |
#eql?(other) ⇒ Boolean
58 59 60 |
# File 'lib/fiona7/builder/batch_widget_writer.rb', line 58 def eql?(other) id.eql?(other.id) end |
#hash ⇒ Object
62 63 64 |
# File 'lib/fiona7/builder/batch_widget_writer.rb', line 62 def hash id.hash end |