Class: Rovi::Response
- Inherits:
-
Object
- Object
- Rovi::Response
- Defined in:
- lib/rovi/response.rb
Instance Method Summary collapse
-
#initialize(data = {}) ⇒ Response
constructor
A new instance of Response.
- #method_missing(m) ⇒ Object
- #success? ⇒ Boolean
Constructor Details
#initialize(data = {}) ⇒ Response
Returns a new instance of Response.
4 5 6 |
# File 'lib/rovi/response.rb', line 4 def initialize(data = {}) @data = data end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(m) ⇒ Object
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/rovi/response.rb', line 12 def method_missing(m) key = m.to_s if @hash != nil and @hash.has_key?(key) v = @hash[key] v = JsonResponse.new(v) if v.is_a?(Hash) return v else super end end |
Instance Method Details
#success? ⇒ Boolean
8 9 10 |
# File 'lib/rovi/response.rb', line 8 def success? @data['status'] end |