Class: Swagger::Data::Example
- Defined in:
- lib/ruby-swagger/data/example.rb
Overview
Instance Attribute Summary collapse
-
#examples ⇒ Object
Returns the value of attribute examples.
Class Method Summary collapse
Instance Method Summary collapse
- #as_swagger ⇒ Object
-
#initialize ⇒ Example
constructor
A new instance of Example.
Methods inherited from Object
attr_swagger, #bulk_set, #swagger_attributes, #to_json, #to_swagger, #to_yaml
Constructor Details
#initialize ⇒ Example
Returns a new instance of Example.
7 8 9 |
# File 'lib/ruby-swagger/data/example.rb', line 7 def initialize @examples = {} end |
Instance Attribute Details
#examples ⇒ Object
Returns the value of attribute examples.
5 6 7 |
# File 'lib/ruby-swagger/data/example.rb', line 5 def examples @examples end |
Class Method Details
.parse(new_examples) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/ruby-swagger/data/example.rb', line 11 def self.parse(new_examples) return nil unless new_examples ex_obj = Swagger::Data::Example.new examples = {} new_examples.each { |example_mime, example| examples[example_mime] = example } ex_obj.examples = examples ex_obj end |
Instance Method Details
#as_swagger ⇒ Object
23 24 25 |
# File 'lib/ruby-swagger/data/example.rb', line 23 def as_swagger @examples end |