Class: Transcriber::Resource::Relation
- Inherits:
-
Association
- Object
- Key
- Association
- Transcriber::Resource::Relation
- 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
Instance Attribute Summary
Attributes inherited from Association
Attributes inherited from Key
#model, #name, #options, #summarize
Instance Method Summary collapse
- #belongs? ⇒ Boolean
- #has? ⇒ Boolean
-
#initialize(name, options = {}) ⇒ Relation
constructor
A new instance of Relation.
- #parse(value, resource = nil) ⇒ Object
Methods included from Response
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, = {}) super @has = .fetch(:has, false) end |
Instance Method Details
#belongs? ⇒ Boolean
16 17 18 |
# File 'lib/transcriber/resource/key/relation.rb', line 16 def belongs? !has? end |
#has? ⇒ Boolean
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 |