Class: RestModel::Relation
- Inherits:
-
Association
- Object
- Key
- Association
- RestModel::Relation
- Includes:
- Response
- Defined in:
- lib/rest_model/key/relation.rb,
lib/rest_model/key/relation/builder.rb,
lib/rest_model/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
- #from_source(value, resource = nil) ⇒ Object (also: #parse)
- #has? ⇒ Boolean
-
#initialize(name, options = {}) ⇒ Relation
constructor
A new instance of Relation.
Methods included from Response
Methods inherited from Association
#default_class_name, #from_hash, #many?, #one?, #resource_class
Methods inherited from Key
#convert_input_keys, #present?, #root_path?, #source_path, #visible?
Constructor Details
#initialize(name, options = {}) ⇒ Relation
Returns a new instance of Relation.
6 7 8 9 |
# File 'lib/rest_model/key/relation.rb', line 6 def initialize(name, = {}) super @has = .fetch(:has, false) end |
Instance Method Details
#belongs? ⇒ Boolean
15 16 17 |
# File 'lib/rest_model/key/relation.rb', line 15 def belongs? !has? end |
#from_source(value, resource = nil) ⇒ Object Also known as: parse
19 20 21 |
# File 'lib/rest_model/key/relation.rb', line 19 def from_source(value, resource = nil) nil end |