Module: ActiveBuilder::ClassMethod

Defined in:
lib/active_builder.rb

Instance Method Summary collapse

Instance Method Details

#attributes(attribute) ⇒ Object



9
10
11
12
13
14
15
16
# File 'lib/active_builder.rb', line 9

def attributes(attribute)
  attr_accessor attribute
  method_name = "with_#{attribute}".to_sym
  define_method(method_name) do |value|
    send("#{attribute}=", value)
    self
  end
end