Class: Azeroth::Decorator::KeyValueExtractor Private
- Inherits:
-
Sinclair::Model
- Object
- Sinclair::Model
- Azeroth::Decorator::KeyValueExtractor
- Defined in:
- lib/azeroth/decorator/key_value_extractor.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Class responsible to extract the value for an attribute
The value is extracted by sending a method call to the decorator
A decorator is infered for the value / attribute or used from the options given
Instance Method Summary collapse
-
#as_json ⇒ Hash
private
Return hash for attribute.
Instance Method Details
#as_json ⇒ Hash
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Return hash for attribute
27 28 29 30 31 32 33 34 35 |
# File 'lib/azeroth/decorator/key_value_extractor.rb', line 27 def as_json return {} unless add_attribute? key = .as || attribute { key.to_s => json_value } end |