Class: Horza::Entities::Single

Inherits:
Hash
  • Object
show all
Includes:
Hashie::Extensions::MethodAccess
Defined in:
lib/horza/entities/single.rb

Direct Known Subclasses

SingleWithActiveModel

Instance Method Summary collapse

Constructor Details

#initialize(attributes) ⇒ Single

Returns a new instance of Single.



8
9
10
# File 'lib/horza/entities/single.rb', line 8

def initialize(attributes)
  update(attributes)
end

Instance Method Details

#generic_getter(name) ⇒ Object Also known as: read_attribute_for_serialization

Some libraries (ie. ActiveModel serializer) use their own methods to access attributes These are aliased to the generic_getter



14
15
16
# File 'lib/horza/entities/single.rb', line 14

def generic_getter(name)
  send(name)
end