Class: Transcriber::Resource::Relation

Inherits:
Association show all
Includes:
Response
Defined in:
lib/transcriber/resource/key/relation.rb,
lib/transcriber/resource/key/relation/builder.rb,
lib/transcriber/resource/key/relation/response.rb

Defined Under Namespace

Modules: Builder, Response

Instance Attribute Summary

Attributes inherited from Association

#many

Attributes inherited from Key

#model, #name, #options, #summarize

Instance Method Summary collapse

Methods included from Response

#to_relation, #to_resource

Methods inherited from Association

#create_from_hash, #default_class_name, #from_hash, #many?, #one?, #resource_class, #update_from_hash

Methods inherited from Key

#convert_input_keys, #input_path, #present?, #root_path?, #visible?

Constructor Details

#initialize(name, options = {}) ⇒ Relation

Returns a new instance of Relation.



7
8
9
10
# File 'lib/transcriber/resource/key/relation.rb', line 7

def initialize(name, options = {})
  super
  @has = options.fetch(:has, false)
end

Instance Method Details

#belongs?Boolean

Returns:



16
17
18
# File 'lib/transcriber/resource/key/relation.rb', line 16

def belongs?
  !has?
end

#has?Boolean

Returns:



12
13
14
# File 'lib/transcriber/resource/key/relation.rb', line 12

def has?
  @has
end

#parse(value, resource = nil) ⇒ Object



20
21
22
# File 'lib/transcriber/resource/key/relation.rb', line 20

def parse(value, resource = nil)
  nil
end