class RangeResponse
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
Public Class Methods
from_array(json)
click to toggle source
Method from_array
creates RangeResponse
object with a set of Range
objects.
# 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