Class: Grape::Entity::Delegator::Base
- Inherits:
-
Object
- Object
- Grape::Entity::Delegator::Base
- Defined in:
- lib/grape_entity/delegator/base.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#object ⇒ Object
readonly
Returns the value of attribute object.
Instance Method Summary collapse
- #accepts_options? ⇒ Boolean
- #delegatable?(_attribute) ⇒ Boolean
-
#initialize(object) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(object) ⇒ Base
Returns a new instance of Base.
9 10 11 |
# File 'lib/grape_entity/delegator/base.rb', line 9 def initialize(object) @object = object end |
Instance Attribute Details
#object ⇒ Object (readonly)
Returns the value of attribute object.
7 8 9 |
# File 'lib/grape_entity/delegator/base.rb', line 7 def object @object end |
Instance Method Details
#accepts_options? ⇒ Boolean
17 18 19 20 |
# File 'lib/grape_entity/delegator/base.rb', line 17 def # Why not `arity > 1`? It might be negative https://ruby-doc.org/core-2.6.6/Method.html#method-i-arity method(:delegate).arity != 1 end |
#delegatable?(_attribute) ⇒ Boolean
13 14 15 |
# File 'lib/grape_entity/delegator/base.rb', line 13 def delegatable?(_attribute) true end |