Module: Weese::Rail::RequiresLine

Includes:
Weese::Requests::Requester
Included in:
MetroRail
Defined in:
lib/weese/rail/line.rb

Overview

These requests require a Line

Instance Method Summary collapse

Methods included from Weese::Requests::Requester

#fetch, #request

Instance Method Details

#stations(line = nil) ⇒ Hash

Station location and address information for all stations on the given line. WMATA Documentation

Parameters:

  • line (String) (defaults to: nil)

    A Line code

Returns:

  • (Hash)

    JSON Response

Raises:



73
74
75
76
77
78
79
80
81
82
83
# File 'lib/weese/rail/line.rb', line 73

def stations(line = nil)
  query = line ? { LineCode: line } : {}

  fetch(
    Requests::Request.new(
      @api_key,
      Rail::Urls::STATIONS,
      query
    )
  )
end