Class: Bonita::Utils::UpdateHandler
- Inherits:
-
Object
- Object
- Bonita::Utils::UpdateHandler
- Includes:
- MappingResolver
- Defined in:
- lib/bonita/utils.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(object, mapper) ⇒ UpdateHandler
constructor
A new instance of UpdateHandler.
Constructor Details
#initialize(object, mapper) ⇒ UpdateHandler
Returns a new instance of UpdateHandler.
54 55 56 57 |
# File 'lib/bonita/utils.rb', line 54 def initialize(object, mapper) @object = object @mapper = mapper end |
Instance Method Details
#call ⇒ Object
59 60 61 62 63 64 65 |
# File 'lib/bonita/utils.rb', line 59 def call if @object.is_a? Hash JSON.dump @object else @mapper.representation_for(:update, @object) end end |