Method: Uinit::Structure::AttributeBuilder#initialize

Defined in:
lib/uinit/structure/attribute_builder.rb

#initialize(defaults, attribute = nil) ⇒ AttributeBuilder



6
7
8
9
10
11
12
13
14
15
# File 'lib/uinit/structure/attribute_builder.rb', line 6

def initialize(defaults, attribute = nil)
  self.attribute = attribute || Attribute.new
  self.defaults = defaults

  return if attribute

  defaults.each do |(name, value)|
    self.attribute.send(:"#{name}=", value)
  end
end