Class: Opower::TimeSeries::Query::GraphingRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/time_series/query.rb

Overview

Generates a graphing request URL from a properly configured Query object.

Instance Method Summary collapse

Constructor Details

#initialize(request) ⇒ GraphingRequest

Initializes the graphing request wrapper using the data found in the Query object.

Parameters:

  • request (Hash)

    query configuration



139
140
141
142
143
# File 'lib/time_series/query.rb', line 139

def initialize(request)
  @parameters = request
  @request = []
  build_request
end

Instance Method Details

#to_sString

Returns the URL for the specified query and its requested data.

Returns:

  • (String)

    URI address for the specified query



148
149
150
# File 'lib/time_series/query.rb', line 148

def to_s
  URI.encode(@request.join('&'))
end