Class: SwaggerModel::SwaggerV2::Relation
- Inherits:
-
Object
- Object
- SwaggerModel::SwaggerV2::Relation
- Defined in:
- lib/swagger_model/relation.rb
Instance Attribute Summary collapse
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(hash) ⇒ Relation
constructor
A new instance of Relation.
- #to_swagger_hash ⇒ Object
Constructor Details
#initialize(hash) ⇒ Relation
Returns a new instance of Relation.
8 9 10 |
# File 'lib/swagger_model/relation.rb', line 8 def initialize(hash) @type = hash['type'] end |
Instance Attribute Details
#type ⇒ Object
Returns the value of attribute type.
7 8 9 |
# File 'lib/swagger_model/relation.rb', line 7 def type @type end |
Instance Method Details
#to_swagger_hash ⇒ Object
12 13 14 15 16 17 |
# File 'lib/swagger_model/relation.rb', line 12 def to_swagger_hash model_name = ActiveSupport::Inflector.classify(@type.gsub('-', '_')) { '$ref' => "#/definitions/#{model_name}" } end |