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
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
-
#initialize(response) ⇒ Ruby
constructor
A new instance of Ruby.
Constructor Details
#initialize(response) ⇒ Ruby
Returns a new instance of Ruby.
40 41 42 43 44 45 46 47 |
# File 'lib/wavefront/response.rb', line 40 def initialize(response) @response = response 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
#response ⇒ Object (readonly)
Returns the value of attribute response.
38 39 40 |
# File 'lib/wavefront/response.rb', line 38 def response @response end |