Module: Inbox::Parameters::ClassMethods

Defined in:
lib/parameters.rb

Instance Method Summary collapse

Instance Method Details

#inherited(subclass) ⇒ Object



20
21
22
23
# File 'lib/parameters.rb', line 20

def inherited(subclass)
  parameters = instance_variable_get("@parameters") || []
  subclass.instance_variable_set("@parameters", parameters.clone)
end

#parameter(*params) ⇒ Object



12
13
14
15
16
17
18
# File 'lib/parameters.rb', line 12

def parameter(*params)
  @parameters ||= []
  params.each do |param|
    attr_accessor param
    @parameters << param.to_s
  end
end