Class: ApiCanon::DocumentedModel

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Serialization
Defined in:
lib/api_canon/documented_model.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#idObject (readonly)

Returns the value of attribute id.



4
5
6
# File 'lib/api_canon/documented_model.rb', line 4

def id
  @id
end

#propertiesObject (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