Method: Hyperclient::Resource#initialize
- Defined in:
- lib/hyperclient/resource.rb
#initialize(representation, entry_point, response = nil) ⇒ Resource
Initializes a Resource.
42 43 44 45 46 47 48 49 50 51 |
# File 'lib/hyperclient/resource.rb', line 42 def initialize(representation, entry_point, response = nil) representation = validate(representation) links = representation['_links'] || {} @_links = LinkCollection.new(links, links['curies'], entry_point) = ResourceCollection.new(representation['_embedded'], entry_point) @_attributes = Attributes.new(representation) @_entry_point = entry_point @_response = response end |