Class: Fiona7::Builder::BatchWidgetWriter::WidgetNode

Inherits:
Object
  • Object
show all
Defined in:
lib/fiona7/builder/batch_widget_writer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#builderObject (readonly)

Returns the value of attribute builder.



38
39
40
# File 'lib/fiona7/builder/batch_widget_writer.rb', line 38

def builder
  @builder
end

#idObject (readonly)

Returns the value of attribute id.



38
39
40
# File 'lib/fiona7/builder/batch_widget_writer.rb', line 38

def id
  @id
end

#valuesObject (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

#dependenciesObject



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

Returns:

  • (Boolean)


58
59
60
# File 'lib/fiona7/builder/batch_widget_writer.rb', line 58

def eql?(other)
  id.eql?(other.id)
end

#hashObject



62
63
64
# File 'lib/fiona7/builder/batch_widget_writer.rb', line 62

def hash
  id.hash
end