Class: Transcriber::Resource::Relation

Inherits:
Association show all
Includes:
Transcriber::Resource::Response::Relation
Defined in:
lib/transcriber/resource/key/relation.rb

Instance Attribute Summary

Attributes inherited from Association

#many

Attributes inherited from Key

#model, #name, #options, #summarize

Instance Method Summary collapse

Methods included from Transcriber::Resource::Response::Relation

#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.



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

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

Instance Method Details

#belongs?Boolean

Returns:



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

def belongs?
  !has?
end

#has?Boolean

Returns:



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

def has?
  @has
end

#parse(value, resource = nil) ⇒ Object



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

def parse(value, resource = nil)
  nil
end