Class: SwaggerModel::SwaggerV2::RelationData
- Inherits:
-
Object
- Object
- SwaggerModel::SwaggerV2::RelationData
- Defined in:
- lib/swagger_model/relation_data.rb
Instance Attribute Summary collapse
-
#relation ⇒ Object
Returns the value of attribute relation.
Instance Method Summary collapse
-
#initialize(hash) ⇒ RelationData
constructor
A new instance of RelationData.
- #to_swagger_hash(key, parent_name) ⇒ Object
Constructor Details
#initialize(hash) ⇒ RelationData
Returns a new instance of RelationData.
5 6 7 |
# File 'lib/swagger_model/relation_data.rb', line 5 def initialize(hash) @relation = Relation.new(hash) end |
Instance Attribute Details
#relation ⇒ Object
Returns the value of attribute relation.
4 5 6 |
# File 'lib/swagger_model/relation_data.rb', line 4 def relation @relation end |
Instance Method Details
#to_swagger_hash(key, parent_name) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/swagger_model/relation_data.rb', line 9 def to_swagger_hash(key, parent_name) name = parent_name + ActiveSupport::Inflector.classify(key.gsub('-', '_')) + 'Data' { name => { 'type' => 'object', 'properties' => { 'data' => @relation.to_swagger_hash } } } end |