Class: Horza::Entities::Single

Inherits:
Hash
  • Object
show all
Extended by:
ActiveSupport::DescendantsTracker
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.



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

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



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

def generic_getter(name)
  send(name)
end