Module: ActiveHash::ARApi::Init
- Included in:
- ActiveMocker::ActiveHash::ARApi
- Defined in:
- lib/active_hash/init.rb
Instance Attribute Summary collapse
-
#associations ⇒ Object
readonly
Returns the value of attribute associations.
-
#types ⇒ Object
readonly
Returns the value of attribute types.
Instance Method Summary collapse
Instance Attribute Details
#associations ⇒ Object (readonly)
Returns the value of attribute associations.
7 8 9 |
# File 'lib/active_hash/init.rb', line 7 def associations @associations end |
#types ⇒ Object (readonly)
Returns the value of attribute types.
7 8 9 |
# File 'lib/active_hash/init.rb', line 7 def types @types end |
Instance Method Details
#initialize(attributes = {}) {|_self| ... } ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/active_hash/init.rb', line 9 def initialize(attributes = {}, &block) @types = {} yield self if block_given? attributes.each do |key, value| begin send "#{key}=", value rescue NoMethodError raise ActiveMocker::RejectedParams, "{:#{key}=>#{value.inspect}} for #{self.class.name}" end end end |