Class: GoogleWallet::Resources::EventTicket::Object
- Defined in:
- lib/google_wallet/resources/event_ticket/object.rb
Instance Attribute Summary collapse
-
#class_id ⇒ Object
readonly
Returns the value of attribute class_id.
-
#class_identifier ⇒ Object
readonly
Returns the value of attribute class_identifier.
-
#currency_code ⇒ Object
readonly
Returns the value of attribute currency_code.
-
#gate ⇒ Object
readonly
Returns the value of attribute gate.
-
#grouping_id ⇒ Object
readonly
Returns the value of attribute grouping_id.
-
#hex_background_color ⇒ Object
readonly
Returns the value of attribute hex_background_color.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#micros ⇒ Object
readonly
Returns the value of attribute micros.
-
#object_identifier ⇒ Object
readonly
Returns the value of attribute object_identifier.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#qr_code_value ⇒ Object
readonly
Returns the value of attribute qr_code_value.
-
#row ⇒ Object
readonly
Returns the value of attribute row.
-
#seat ⇒ Object
readonly
Returns the value of attribute seat.
-
#section ⇒ Object
readonly
Returns the value of attribute section.
-
#ticket_holder_name ⇒ Object
readonly
Returns the value of attribute ticket_holder_name.
-
#ticket_number ⇒ Object
readonly
Returns the value of attribute ticket_number.
-
#ticket_type ⇒ Object
readonly
Returns the value of attribute ticket_type.
-
#valid_time_end ⇒ Object
readonly
Returns the value of attribute valid_time_end.
-
#valid_time_start ⇒ Object
readonly
Returns the value of attribute valid_time_start.
Instance Method Summary collapse
-
#initialize(attributes: {}, options: {}) ⇒ Object
constructor
attributes = { object_identifier: ‘fd9b637f-0381-42ad-9161-b4d887d79d9f’, class_identifier: ‘Event-1234’, grouping_id: ‘order-12345’, ticket_type: ‘Vip Pass + Priority24’, section: ‘The Sponsor Felt-F Overpower’, seat: ‘65’, row: ‘17’, gate: ‘G3, G4’, ticket_holder_name: ‘Yaro Developer’, qr_code_value: ‘12345678’, ref_number: ‘cdeqw’, valid_time_start: ‘2023-09-27T22:30’, valid_time_end: ‘2023-09-28T02:00’, micros: 82_000_000, currency_code: ‘NOK’, hex_background_color: ‘#45ffaa’ }.
- #payload_key ⇒ Object
- #push ⇒ Object
- #sign(push_resource: true) ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(attributes: {}, options: {}) ⇒ Object
attributes =
object_identifier: 'fd9b637f-0381-42ad-9161-b4d887d79d9f',
class_identifier: 'Event-1234',
grouping_id: 'order-12345',
ticket_type: 'Vip Pass + Priority24',
section: 'The Sponsor Felt-F Overpower',
seat: '65',
row: '17',
gate: 'G3, G4',
ticket_holder_name: 'Yaro Developer',
qr_code_value: '12345678',
ref_number: 'cdeqw',
valid_time_start: '2023-09-27T22:30',
valid_time_end: '2023-09-28T02:00',
micros: 82_000_000,
currency_code: 'NOK',
hex_background_color: '#45ffaa'
33 34 35 36 37 38 39 |
# File 'lib/google_wallet/resources/event_ticket/object.rb', line 33 def initialize(attributes: {}, options: {}) super validate_fields( %w[object_identifier class_identifier]) @id = "#{GoogleWallet.configuration.issuer_id}.#{@object_identifier}" @class_id = "#{GoogleWallet.configuration.issuer_id}.#{@class_identifier}" end |
Instance Attribute Details
#class_id ⇒ Object (readonly)
Returns the value of attribute class_id.
8 9 10 |
# File 'lib/google_wallet/resources/event_ticket/object.rb', line 8 def class_id @class_id end |
#class_identifier ⇒ Object (readonly)
Returns the value of attribute class_identifier.
8 9 10 |
# File 'lib/google_wallet/resources/event_ticket/object.rb', line 8 def class_identifier @class_identifier end |
#currency_code ⇒ Object (readonly)
Returns the value of attribute currency_code.
8 9 10 |
# File 'lib/google_wallet/resources/event_ticket/object.rb', line 8 def currency_code @currency_code end |
#gate ⇒ Object (readonly)
Returns the value of attribute gate.
8 9 10 |
# File 'lib/google_wallet/resources/event_ticket/object.rb', line 8 def gate @gate end |
#grouping_id ⇒ Object (readonly)
Returns the value of attribute grouping_id.
8 9 10 |
# File 'lib/google_wallet/resources/event_ticket/object.rb', line 8 def grouping_id @grouping_id end |
#hex_background_color ⇒ Object (readonly)
Returns the value of attribute hex_background_color.
8 9 10 |
# File 'lib/google_wallet/resources/event_ticket/object.rb', line 8 def hex_background_color @hex_background_color end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
8 9 10 |
# File 'lib/google_wallet/resources/event_ticket/object.rb', line 8 def id @id end |
#micros ⇒ Object (readonly)
Returns the value of attribute micros.
8 9 10 |
# File 'lib/google_wallet/resources/event_ticket/object.rb', line 8 def micros @micros end |
#object_identifier ⇒ Object (readonly)
Returns the value of attribute object_identifier.
8 9 10 |
# File 'lib/google_wallet/resources/event_ticket/object.rb', line 8 def object_identifier @object_identifier end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
8 9 10 |
# File 'lib/google_wallet/resources/event_ticket/object.rb', line 8 def @options end |
#qr_code_value ⇒ Object (readonly)
Returns the value of attribute qr_code_value.
8 9 10 |
# File 'lib/google_wallet/resources/event_ticket/object.rb', line 8 def qr_code_value @qr_code_value end |
#row ⇒ Object (readonly)
Returns the value of attribute row.
8 9 10 |
# File 'lib/google_wallet/resources/event_ticket/object.rb', line 8 def row @row end |
#seat ⇒ Object (readonly)
Returns the value of attribute seat.
8 9 10 |
# File 'lib/google_wallet/resources/event_ticket/object.rb', line 8 def seat @seat end |
#section ⇒ Object (readonly)
Returns the value of attribute section.
8 9 10 |
# File 'lib/google_wallet/resources/event_ticket/object.rb', line 8 def section @section end |
#ticket_holder_name ⇒ Object (readonly)
Returns the value of attribute ticket_holder_name.
8 9 10 |
# File 'lib/google_wallet/resources/event_ticket/object.rb', line 8 def ticket_holder_name @ticket_holder_name end |
#ticket_number ⇒ Object (readonly)
Returns the value of attribute ticket_number.
8 9 10 |
# File 'lib/google_wallet/resources/event_ticket/object.rb', line 8 def ticket_number @ticket_number end |
#ticket_type ⇒ Object (readonly)
Returns the value of attribute ticket_type.
8 9 10 |
# File 'lib/google_wallet/resources/event_ticket/object.rb', line 8 def ticket_type @ticket_type end |
#valid_time_end ⇒ Object (readonly)
Returns the value of attribute valid_time_end.
8 9 10 |
# File 'lib/google_wallet/resources/event_ticket/object.rb', line 8 def valid_time_end @valid_time_end end |
#valid_time_start ⇒ Object (readonly)
Returns the value of attribute valid_time_start.
8 9 10 |
# File 'lib/google_wallet/resources/event_ticket/object.rb', line 8 def valid_time_start @valid_time_start end |
Instance Method Details
#payload_key ⇒ Object
59 60 61 |
# File 'lib/google_wallet/resources/event_ticket/object.rb', line 59 def payload_key "#{payload_key_logic}Objects" end |
#push ⇒ Object
41 42 43 44 |
# File 'lib/google_wallet/resources/event_ticket/object.rb', line 41 def push access_token = GoogleWallet::Authentication.new.access_token GoogleWallet::Operations::EventTicket::PushObject.new(resource: self, access_token: access_token).call end |
#sign(push_resource: true) ⇒ Object
46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/google_wallet/resources/event_ticket/object.rb', line 46 def sign(push_resource: true) sign_operation = if push_resource push GoogleWallet::Operations::SignObjects.new(resource_ids: [id], objects_type: self.payload_key) else GoogleWallet::Operations::SignObjects.new(resources: [itself]) end sign_operation.call sign_operation.jwt end |