Class: Grape::Roar::Extensions::Relations::Adapters::Base
- Inherits:
-
Object
- Object
- Grape::Roar::Extensions::Relations::Adapters::Base
- Defined in:
- lib/grape/roar/extensions/relations/adapters/base.rb
Direct Known Subclasses
Class Method Summary collapse
Instance Method Summary collapse
- #collection_methods ⇒ Object
-
#initialize(klass) ⇒ Base
constructor
A new instance of Base.
- #name_for_represented(_represented) ⇒ Object
- #single_entity_methods ⇒ Object
Constructor Details
#initialize(klass) ⇒ Base
Returns a new instance of Base.
25 26 27 |
# File 'lib/grape/roar/extensions/relations/adapters/base.rb', line 25 def initialize(klass) @klass = klass end |
Class Method Details
.valid_for(&block) ⇒ Object
16 17 18 |
# File 'lib/grape/roar/extensions/relations/adapters/base.rb', line 16 def valid_for(&block) @valid_proc = block end |
.valid_for?(klass) ⇒ Boolean
10 11 12 13 14 |
# File 'lib/grape/roar/extensions/relations/adapters/base.rb', line 10 def valid_for?(klass) valid_proc.call(klass) rescue StandardError false end |
Instance Method Details
#collection_methods ⇒ Object
29 30 31 |
# File 'lib/grape/roar/extensions/relations/adapters/base.rb', line 29 def collection_methods raise NotImplementedError end |
#name_for_represented(_represented) ⇒ Object
33 34 35 |
# File 'lib/grape/roar/extensions/relations/adapters/base.rb', line 33 def name_for_represented(_represented) raise NotImplementedError end |
#single_entity_methods ⇒ Object
37 38 39 |
# File 'lib/grape/roar/extensions/relations/adapters/base.rb', line 37 def single_entity_methods raise NotImplementedError end |