Class: JSONAPI::Realizer::Resource::Relation

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Model
Defined in:
lib/jsonapi/realizer/resource/relation.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**keyword_arguments) ⇒ Relation

Returns a new instance of Relation.



21
22
23
24
25
# File 'lib/jsonapi/realizer/resource/relation.rb', line 21

def initialize(**keyword_arguments)
  super(**keyword_arguments)

  validate!
end

Instance Attribute Details

#asObject

Returns the value of attribute as.



12
13
14
# File 'lib/jsonapi/realizer/resource/relation.rb', line 12

def as
  @as
end

#nameObject

Returns the value of attribute name.



10
11
12
# File 'lib/jsonapi/realizer/resource/relation.rb', line 10

def name
  @name
end

#ownerObject

Returns the value of attribute owner.



9
10
11
# File 'lib/jsonapi/realizer/resource/relation.rb', line 9

def owner
  @owner
end

#realizer_class_nameObject

Returns the value of attribute realizer_class_name.



13
14
15
# File 'lib/jsonapi/realizer/resource/relation.rb', line 13

def realizer_class_name
  @realizer_class_name
end

#typeObject

Returns the value of attribute type.



11
12
13
# File 'lib/jsonapi/realizer/resource/relation.rb', line 11

def type
  @type
end

Instance Method Details

#realizer_classObject



27
28
29
# File 'lib/jsonapi/realizer/resource/relation.rb', line 27

def realizer_class
  realizer_class_name.constantize
end