Class: Weese::Requests::Request

Inherits:
Object
  • Object
show all
Defined in:
lib/weese/requests.rb

Overview

Everything needed to make an HTTP request

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_key, path, query) ⇒ Request

Create a Request

Parameters:

  • api_key (String)

    API key to make this Request with

  • path (String)

    URL to make Request to

  • query (Hash)

    Query parameters to append to Request



25
26
27
28
29
# File 'lib/weese/requests.rb', line 25

def initialize(api_key, path, query)
  @api_key = api_key
  @path = path
  @query = query
end

Instance Attribute Details

#api_keyString

Returns WMATA API key.

Returns:



12
13
14
# File 'lib/weese/requests.rb', line 12

def api_key
  @api_key
end

#pathString

Returns URL.

Returns:



14
15
16
# File 'lib/weese/requests.rb', line 14

def path
  @path
end

#queryHash

Returns Query parameters.

Returns:

  • (Hash)

    Query parameters



16
17
18
# File 'lib/weese/requests.rb', line 16

def query
  @query
end