Class: ApiCanon::DocumentedModel
- Inherits:
-
Object
- Object
- ApiCanon::DocumentedModel
- Includes:
- ActiveModel::Serialization
- Defined in:
- lib/api_canon/documented_model.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#properties ⇒ Object
readonly
Returns the value of attribute properties.
Instance Method Summary collapse
-
#initialize(id) ⇒ DocumentedModel
constructor
A new instance of DocumentedModel.
- #property(name, opts = {}) ⇒ Object
Constructor Details
#initialize(id) ⇒ DocumentedModel
Returns a new instance of DocumentedModel.
5 6 7 8 |
# File 'lib/api_canon/documented_model.rb', line 5 def initialize(id) @id = id @properties = {} end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
4 5 6 |
# File 'lib/api_canon/documented_model.rb', line 4 def id @id end |
#properties ⇒ Object (readonly)
Returns the value of attribute properties.
4 5 6 |
# File 'lib/api_canon/documented_model.rb', line 4 def properties @properties end |
Instance Method Details
#property(name, opts = {}) ⇒ Object
9 10 11 |
# File 'lib/api_canon/documented_model.rb', line 9 def property(name, opts={}) @properties[name] = opts end |