Class: Googlepay::EventTicketClass
- Inherits:
-
Object
- Object
- Googlepay::EventTicketClass
- Defined in:
- lib/googlepay/event_ticket_class.rb
Constant Summary collapse
- EVENT_URL =
'https://www.googleapis.com/walletobjects/v1/eventTicketClass'
Instance Method Summary collapse
- #create ⇒ Object
-
#initialize(parameters) ⇒ EventTicketClass
constructor
A new instance of EventTicketClass.
- #update ⇒ Object
Constructor Details
#initialize(parameters) ⇒ EventTicketClass
Returns a new instance of EventTicketClass.
6 7 8 |
# File 'lib/googlepay/event_ticket_class.rb', line 6 def initialize(parameters) @parameters = parameters end |
Instance Method Details
#create ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/googlepay/event_ticket_class.rb', line 10 def create result = HTTParty.post("#{EVENT_URL}?access_token=#{Googlepay.token}", :body => @parameters.to_json, :headers => { 'Content-Type' => 'application/json' } ) return result if result['error'].nil? update if result['error']['code'] == 409 end |