Module: Ripple::Properties
- Defined in:
- lib/ripple/properties.rb
Overview
Adds the ability to declare properties on your Ripple::Document class. Properties will automatically generate accessor (get/set/query) methods and handle type-casting between your Ruby type and JSON-compatible types.
Instance Method Summary collapse
- #inherited(subclass) ⇒ Object
-
#properties ⇒ Hash
The properties defined on the document.
- #property(key, type, options = {}) ⇒ Object
Instance Method Details
#inherited(subclass) ⇒ Object
11 12 13 14 |
# File 'lib/ripple/properties.rb', line 11 def inherited(subclass) super subclass.properties.merge!(properties) end |
#properties ⇒ Hash
Returns the properties defined on the document.
17 18 19 |
# File 'lib/ripple/properties.rb', line 17 def properties @properties ||= {}.with_indifferent_access end |