Class: Arrest::NestedResource

Inherits:
Object
  • Object
show all
Includes:
BelongsTo, HasAttributes
Defined in:
lib/arrest/nested_resource.rb

Overview

A nested resource has no own url It is an embedded entity in an actual RestResource or an other NestedResource

Instance Attribute Summary collapse

Attributes included from HasAttributes

#attribute_values

Instance Method Summary collapse

Methods included from BelongsTo

included

Methods included from HasAttributes

#attributes, #attributes=, included, #init_from_hash, #initialize_has_attributes, #load_from_stub, #stubbed?, #to_hash, #to_jhash, #update_attributes

Constructor Details

#initialize(parent, h) ⇒ NestedResource

Returns a new instance of NestedResource.



11
12
13
14
# File 'lib/arrest/nested_resource.rb', line 11

def initialize parent, h
  @parent = parent
  init_from_hash h
end

Instance Attribute Details

#parentObject (readonly)

Returns the value of attribute parent.



9
10
11
# File 'lib/arrest/nested_resource.rb', line 9

def parent
  @parent
end

Instance Method Details

#contextObject



16
17
18
# File 'lib/arrest/nested_resource.rb', line 16

def context
  parent.context
end