Class: Skeleton::Example
- Inherits:
-
Object
- Object
- Skeleton::Example
- Defined in:
- lib/skeleton/example.rb
Instance Method Summary collapse
- #[](mime_type) ⇒ Object
- #[]=(mime_type, value) ⇒ Object
-
#initialize ⇒ Example
constructor
A new instance of Example.
- #to_h ⇒ Object
- #to_swagger_hash ⇒ Object
Constructor Details
#initialize ⇒ Example
Returns a new instance of Example.
3 4 5 |
# File 'lib/skeleton/example.rb', line 3 def initialize @mimes = {} end |
Instance Method Details
#[](mime_type) ⇒ Object
11 12 13 |
# File 'lib/skeleton/example.rb', line 11 def [](mime_type) @mimes[mime_type] end |
#[]=(mime_type, value) ⇒ Object
7 8 9 |
# File 'lib/skeleton/example.rb', line 7 def []=(mime_type, value) @mimes[mime_type] = value end |
#to_h ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/skeleton/example.rb', line 15 def to_h hash = {} @mimes.each do |type, value| hash[type] = value.respond_to?(:to_h) ? value.to_h : value end hash end |
#to_swagger_hash ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/skeleton/example.rb', line 23 def to_swagger_hash hash = {} @mimes.each do |type, value| hash[type] = value.respond_to?(:to_h) ? value.to_swagger_hash : value end hash end |