Module: ONEAccess::Serializable
- Included in:
- DataObject::Address, DataObject::City, DataObject::Company, DataObject::CompanyLight, DataObject::Contributor, DataObject::Country, DataObject::GlobalRegion, DataObject::Inducement, DataObject::Industry, DataObject::Investor, DataObject::Meta, DataObject::Organization, DataObject::OrganizationLight, DataObject::ProductGroup, DataObject::ProvidersUserDetails, DataObject::ProvidersUserDetailsVendor, DataObject::ProvidersUsersDetails, DataObject::Region, DataObject::ResearchDocumentInfo, DataObject::SAMLInfo, DataObject::SellSideUserGroupEntitlement, DataObject::User, DataObject::UserEntitlementRequest, DataObject::UserLight, Response::BaseResponse, Response::BuySideInteractionsResponse, Response::CollectionResponse, Response::ContributorsResponse, Response::InvestorsResponse, Response::OrganizationResponse
- Defined in:
- lib/oneaccess/serializable.rb
Instance Method Summary collapse
Instance Method Details
#from_json(json) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/oneaccess/serializable.rb', line 9 def from_json(json) if collection? collection = [] @representer_class.new(collection).from_json(json) collection else obj = new @representer_class.new(obj).from_json(json) obj end end |
#represented_by(representer_class) ⇒ Object
5 6 7 |
# File 'lib/oneaccess/serializable.rb', line 5 def represented_by(representer_class) @representer_class = representer_class end |