Class: RangeResponse
Overview
Class RangeResponse represents server response on range
Search API request. Server response is sent to from_array
method which creates objects with attribute ranges
accessible via getter:
response = RangeResponse.from_array(...)
response.ranges # => Array
Defined Under Namespace
Classes: Range
Instance Attribute Summary collapse
-
#ranges ⇒ Object
Returns the value of attribute ranges.
Class Method Summary collapse
-
.from_array(json) ⇒ Object
Method
from_array
creates RangeResponse object with a set of Range objects.
Methods inherited from Struct
Instance Attribute Details
#ranges ⇒ Object
Returns the value of attribute ranges
8 9 10 |
# File 'lib/dto/search/range_response.rb', line 8 def ranges @ranges end |
Class Method Details
.from_array(json) ⇒ Object
Method from_array
creates RangeResponse object with a set of Range objects.
23 24 25 |
# File 'lib/dto/search/range_response.rb', line 23 def self.from_array(json) self.from_hash(:ranges => json.collect { |key, value| Range.from_hash( :field => key, :max => value["max"], :min => value["min"])}) end |