Class: Swagger::Data::Reference

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby-swagger/data/reference.rb

Overview

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Object

attr_swagger, #bulk_set, #swagger_attributes, #to_json, #to_swagger, #to_yaml

Instance Attribute Details

#refObject

Returns the value of attribute ref.



20
21
22
# File 'lib/ruby-swagger/data/reference.rb', line 20

def ref
  @ref
end

Class Method Details

.parse(reference) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/ruby-swagger/data/reference.rb', line 7

def self.parse(reference)
  return nil unless reference

  r = Swagger::Data::Reference.new
  r.ref = reference['$ref']
  r
end

Instance Method Details

#as_swaggerObject



22
23
24
# File 'lib/ruby-swagger/data/reference.rb', line 22

def as_swagger
  @ref.nil? ? {} : { '$ref' => @ref }
end