Method: Eipiai::Representable#to_h

Defined in:
lib/eipiai/models/representable.rb

#to_h(options = {}) ⇒ Hash

to_h

call ‘#to_h` on the representer belonging to the object.

Examples:

item = Item.new.extend(Eipiai::Representable)
item.to_h # => { '_links' => { 'self' => { 'href' => '/item' } } }

Parameters:

  • options (Hash) (defaults to: {})

    to be used inside the representer

Returns:

  • (Hash)

    hash representation of the object



36
37
38
# File 'lib/eipiai/models/representable.rb', line 36

def to_h(options = {})
  represented.to_h(options)
end