Class: MLB::Transactions

Inherits:
Shale::Mapper
  • Object
show all
Defined in:
lib/mlb/transactions.rb

Class Method Summary collapse

Class Method Details

.between(start_date: Date.today, end_date: start_date) ⇒ Object



10
11
12
13
14
15
16
# File 'lib/mlb/transactions.rb', line 10

def self.between(start_date: Date.today, end_date: start_date)
  params = {startDate: start_date, endDate: end_date}
  query_string = URI.encode_www_form(params)
  response = CLIENT.get("transactions?#{query_string}")
  transactions = from_json(response)
  transactions.transactions
end