Module: Vandelay::Buildable::ClassMethods

Defined in:
lib/vandelay/buildable.rb

Instance Method Summary collapse

Instance Method Details

#__set_defaultObject

Stub for documentation

Parameters:

  • attribute (Symbol)

    fields built in the internal hash

  • default (Object)

    the default value for those fields


74
75
# File 'lib/vandelay/buildable.rb', line 74

def __set_default
end

#made_of(*attributes, default: nil) ⇒ void

This method returns an undefined value.

Method used to declare fields which will get implemented in the builder. Accepts a default argument that will be used if no value is set.

Parameters:

  • attributes (Array)

    fields that ought to be set on the builder

  • default (Object)

    the default value for all passed attributes


64
65
66
67
68
# File 'lib/vandelay/buildable.rb', line 64

def made_of(*attributes, default: nil)
  attributes.each do |attribute|
    compose_setter(attribute, default)
  end
end