Class: Grape::Entity::Delegator::PlainObject

Inherits:
Base
  • Object
show all
Defined in:
lib/grape_entity/delegator/plain_object.rb

Instance Attribute Summary

Attributes inherited from Base

#object

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Grape::Entity::Delegator::Base

Instance Method Details

#delegatable?(attribute) ⇒ Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/grape_entity/delegator/plain_object.rb', line 9

def delegatable?(attribute)
  object.respond_to? attribute, true
end

#delegate(attribute) ⇒ Object



5
6
7
# File 'lib/grape_entity/delegator/plain_object.rb', line 5

def delegate(attribute)
  object.send attribute
end