Class: LunaApi::Sale

Inherits:
OpenStruct
  • Object
show all
Defined in:
lib/luna_api/sale.rb

Constant Summary collapse

URL =
"http://luna-data.herokuapp.com/transactions"

Class Method Summary collapse

Class Method Details

.allObject



4
5
6
7
# File 'lib/luna_api/sale.rb', line 4

def self.all
  response = LunaApi::Request.get(URL)
  sales = JSON.parse(response.body)
end

.create(attrs) ⇒ Object



9
10
11
# File 'lib/luna_api/sale.rb', line 9

def self.create(attrs)
  response = LunaApi::Request.post(URL, params: attrs)
end