Class: Wavefront::Response::Ruby
- Inherits:
-
Object
- Object
- Wavefront::Response::Ruby
- Includes:
- JSON
- Defined in:
- lib/wavefront/response.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
-
#initialize(response, options = {}) ⇒ Ruby
constructor
A new instance of Ruby.
Constructor Details
#initialize(response, options = {}) ⇒ Ruby
Returns a new instance of Ruby.
43 44 45 46 47 48 49 50 51 |
# File 'lib/wavefront/response.rb', line 43 def initialize(response, ={}) @response = response @options = JSON.parse(response).each_pair do |k,v| self.instance_variable_set("@#{k}", v) # Dynamically populate instance vars self.class.__send__(:attr_reader, k) # and set accessors end end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
41 42 43 |
# File 'lib/wavefront/response.rb', line 41 def @options end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
41 42 43 |
# File 'lib/wavefront/response.rb', line 41 def response @response end |