Class: GoogleWallet::Resources::EventTicket::Class

Inherits:
Base
  • Object
show all
Defined in:
lib/google_wallet/resources/event_ticket/class.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#options

Instance Method Summary collapse

Methods inherited from Base

#attributes

Constructor Details

#initialize(attributes: {}, options: {}) ⇒ Class

Returns a new instance of Class.



30
31
32
33
34
# File 'lib/google_wallet/resources/event_ticket/class.rb', line 30

def initialize(attributes: {}, options: {})
  super
  validate_fields( %w[class_identifier event_name issuer_name])
  @id = "#{GoogleWallet.configuration.issuer_id}.#{@class_identifier}"
end

Instance Attribute Details

#callback_urlObject (readonly)

Returns the value of attribute callback_url.



7
8
9
# File 'lib/google_wallet/resources/event_ticket/class.rb', line 7

def callback_url
  @callback_url
end

#class_identifierObject (readonly)

Returns the value of attribute class_identifier.



7
8
9
# File 'lib/google_wallet/resources/event_ticket/class.rb', line 7

def class_identifier
  @class_identifier
end

#country_codeObject (readonly)

Returns the value of attribute country_code.



7
8
9
# File 'lib/google_wallet/resources/event_ticket/class.rb', line 7

def country_code
  @country_code
end

#end_date_timeObject (readonly)

Returns the value of attribute end_date_time.



7
8
9
# File 'lib/google_wallet/resources/event_ticket/class.rb', line 7

def end_date_time
  @end_date_time
end

#event_idObject (readonly)

Returns the value of attribute event_id.



7
8
9
# File 'lib/google_wallet/resources/event_ticket/class.rb', line 7

def event_id
  @event_id
end

#event_nameObject (readonly)

Returns the value of attribute event_name.



7
8
9
# File 'lib/google_wallet/resources/event_ticket/class.rb', line 7

def event_name
  @event_name
end

#hero_image_urlObject (readonly)

Returns the value of attribute hero_image_url.



7
8
9
# File 'lib/google_wallet/resources/event_ticket/class.rb', line 7

def hero_image_url
  @hero_image_url
end

#hex_background_colorObject (readonly)

Returns the value of attribute hex_background_color.



7
8
9
# File 'lib/google_wallet/resources/event_ticket/class.rb', line 7

def hex_background_color
  @hex_background_color
end

#homepage_urlObject (readonly)

Returns the value of attribute homepage_url.



7
8
9
# File 'lib/google_wallet/resources/event_ticket/class.rb', line 7

def homepage_url
  @homepage_url
end

#idObject (readonly)

Returns the value of attribute id.



7
8
9
# File 'lib/google_wallet/resources/event_ticket/class.rb', line 7

def id
  @id
end

#issuer_nameObject (readonly)

Returns the value of attribute issuer_name.



7
8
9
# File 'lib/google_wallet/resources/event_ticket/class.rb', line 7

def issuer_name
  @issuer_name
end

#logo_urlObject (readonly)

Returns the value of attribute logo_url.



7
8
9
# File 'lib/google_wallet/resources/event_ticket/class.rb', line 7

def logo_url
  @logo_url
end

#start_date_timeObject (readonly)

Returns the value of attribute start_date_time.



7
8
9
# File 'lib/google_wallet/resources/event_ticket/class.rb', line 7

def start_date_time
  @start_date_time
end

#venue_addressObject (readonly)

Returns the value of attribute venue_address.



7
8
9
# File 'lib/google_wallet/resources/event_ticket/class.rb', line 7

def venue_address
  @venue_address
end

#venue_nameObject (readonly)

Returns the value of attribute venue_name.



7
8
9
# File 'lib/google_wallet/resources/event_ticket/class.rb', line 7

def venue_name
  @venue_name
end

Instance Method Details

#payload_keyObject



47
48
49
# File 'lib/google_wallet/resources/event_ticket/class.rb', line 47

def payload_key
  "#{payload_key_logic}Classes"
end

#pushObject



36
37
38
39
# File 'lib/google_wallet/resources/event_ticket/class.rb', line 36

def push
  access_token = GoogleWallet::Authentication.new.access_token
  GoogleWallet::Operations::EventTicket::PushClass.new(resource: self, access_token: access_token).call
end

#sign(push_resource: true) ⇒ Object



41
42
43
44
45
# File 'lib/google_wallet/resources/event_ticket/class.rb', line 41

def sign(push_resource: true)
  raise "Class cannot be signed without Object,
        use GoogleWallet::Operations::SignObjects.new(...)
        to create/modify simultaneously classes and objects by following jwt link"
end