Class: Skeleton::Example

Inherits:
Object
  • Object
show all
Defined in:
lib/skeleton/example.rb

Instance Method Summary collapse

Constructor Details

#initializeExample

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_hObject



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_hashObject



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