Class: ExpressPigeon::MetaResponse
- Inherits:
-
Object
- Object
- ExpressPigeon::MetaResponse
show all
- Defined in:
- lib/expresspigeon-ruby/meta_response.rb
Instance Method Summary
collapse
Constructor Details
Returns a new instance of MetaResponse.
4
5
6
7
8
9
10
11
12
|
# File 'lib/expresspigeon-ruby/meta_response.rb', line 4
def initialize(delegate)
@delegate = delegate
@delegate.each_key do |k|
v = @delegate[k]
if v.kind_of? Hash
@delegate[k] = MetaResponse.new(v)
end
end
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(m, *args, &block) ⇒ Object
14
15
16
|
# File 'lib/expresspigeon-ruby/meta_response.rb', line 14
def method_missing(m, *args, &block)
@delegate[m.to_s]
end
|
Instance Method Details
#inspect ⇒ Object
26
27
28
|
# File 'lib/expresspigeon-ruby/meta_response.rb', line 26
def inspect
@delegate.inspect
end
|
#respond_to?(m, include_all = false) ⇒ Boolean
18
19
20
|
# File 'lib/expresspigeon-ruby/meta_response.rb', line 18
def respond_to?(m, include_all = false)
@delegate.key?(m.to_s)
end
|
#to_s ⇒ Object
22
23
24
|
# File 'lib/expresspigeon-ruby/meta_response.rb', line 22
def to_s
@delegate.to_s
end
|