Class: Hahamut::Attribute::Json
- Defined in:
- lib/hahamut/attribute/json.rb
Overview
JSON Attribute
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
#as_json, #initialize, #to_json
Constructor Details
This class inherits a constructor from Hahamut::Attribute::Base
Instance Method Details
#value ⇒ Object
7 8 9 10 11 |
# File 'lib/hahamut/attribute/json.rb', line 7 def value @value ||= before_cast.as_json if before_cast.respond_to?(:as_json) @value ||= before_cast if before_cast.is_a?(Hash) @value ||= {} end |