Class: HOALife::Account

Inherits:
Resource show all
Includes:
Resources::Persistable
Defined in:
lib/hoalife/account.rb

Overview

:nodoc

Constant Summary

Constants included from Arrayable

HOALife::Arrayable::BLANK_RE

Instance Attribute Summary

Attributes inherited from Resource

#attrs

Instance Method Summary collapse

Methods inherited from Resource

#==, #initialize, #method_missing, new, resource_collection, #respond_to?, #to_json

Methods included from Arrayable

#as_array

Constructor Details

This class inherits a constructor from HOALife::Resource

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class HOALife::Resource

Instance Method Details

#as_jsonObject



9
10
11
12
13
14
15
16
17
# File 'lib/hoalife/account.rb', line 9

def as_json
  h = super

  h.dig('data', 'relationships').merge!(
    'parent' => { 'data' => { 'id' => parent_id } }
  )

  h
end