Class: SimpleRepresenter::Property

Inherits:
Field
  • Object
show all
Defined in:
lib/simple_representer/property.rb

Instance Attribute Summary

Attributes inherited from Field

#field, #options

Instance Method Summary collapse

Methods inherited from Field

#call, #initialize

Constructor Details

This class inherits a constructor from SimpleRepresenter::Field

Instance Method Details

#process(representer) ⇒ Object



7
8
9
10
11
# File 'lib/simple_representer/property.rb', line 7

def process(representer)
  return nil unless representer.represented.respond_to?(field)

  representer.represented.public_send(field)
end