Class: SpreeCmCommissioner::Integrations::StadiumXV1::Resources::Ticket
- Inherits:
-
Base
- Object
- Base
- SpreeCmCommissioner::Integrations::StadiumXV1::Resources::Ticket
- Defined in:
- app/services/spree_cm_commissioner/integrations/stadium_x_v1/resources/ticket.rb
Instance Attribute Summary collapse
-
#__v ⇒ Object
Returns the value of attribute __v.
-
#_id ⇒ Object
Returns the value of attribute _id.
-
#cashback ⇒ Object
Returns the value of attribute cashback.
-
#club_id ⇒ Object
Returns the value of attribute club_id.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#first_uid ⇒ Object
Returns the value of attribute first_uid.
-
#generated_by ⇒ Object
Returns the value of attribute generated_by.
-
#is_expired ⇒ Object
Returns the value of attribute is_expired.
-
#is_online ⇒ Object
Returns the value of attribute is_online.
-
#is_used ⇒ Object
Returns the value of attribute is_used.
-
#league_id ⇒ Object
Returns the value of attribute league_id.
-
#match_id ⇒ Object
Returns the value of attribute match_id.
-
#payment_method ⇒ Object
Returns the value of attribute payment_method.
-
#remark ⇒ Object
Returns the value of attribute remark.
-
#ticket_type ⇒ Object
Returns the value of attribute ticket_type.
-
#token_id ⇒ Object
Returns the value of attribute token_id.
-
#uid ⇒ Object
Returns the value of attribute uid.
-
#updated_at ⇒ Object
Returns the value of attribute updated_at.
-
#used_at ⇒ Object
Returns the value of attribute used_at.
-
#zone_id ⇒ Object
Returns the value of attribute zone_id.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Ticket
constructor
A new instance of Ticket.
- #to_h ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(attributes = {}) ⇒ Ticket
Returns a new instance of Ticket.
25 26 27 28 29 30 31 32 33 34 |
# File 'app/services/spree_cm_commissioner/integrations/stadium_x_v1/resources/ticket.rb', line 25 def initialize(attributes = {}) super(attributes) @is_used = attributes['is_used'] == true || attributes['is_used'] == 'true' @is_online = attributes['is_online'] != false @is_expired = attributes['is_expired'] == true || attributes['is_expired'] == 'true' @created_at = (attributes['created_at']) @updated_at = (attributes['updated_at']) @used_at = (attributes['used_at']) end |
Instance Attribute Details
#__v ⇒ Object
Returns the value of attribute __v.
4 5 6 |
# File 'app/services/spree_cm_commissioner/integrations/stadium_x_v1/resources/ticket.rb', line 4 def __v @__v end |
#_id ⇒ Object
Returns the value of attribute _id.
4 5 6 |
# File 'app/services/spree_cm_commissioner/integrations/stadium_x_v1/resources/ticket.rb', line 4 def _id @_id end |
#cashback ⇒ Object
Returns the value of attribute cashback.
4 5 6 |
# File 'app/services/spree_cm_commissioner/integrations/stadium_x_v1/resources/ticket.rb', line 4 def cashback @cashback end |
#club_id ⇒ Object
Returns the value of attribute club_id.
4 5 6 |
# File 'app/services/spree_cm_commissioner/integrations/stadium_x_v1/resources/ticket.rb', line 4 def club_id @club_id end |
#created_at ⇒ Object
Returns the value of attribute created_at.
4 5 6 |
# File 'app/services/spree_cm_commissioner/integrations/stadium_x_v1/resources/ticket.rb', line 4 def created_at @created_at end |
#first_uid ⇒ Object
Returns the value of attribute first_uid.
4 5 6 |
# File 'app/services/spree_cm_commissioner/integrations/stadium_x_v1/resources/ticket.rb', line 4 def first_uid @first_uid end |
#generated_by ⇒ Object
Returns the value of attribute generated_by.
4 5 6 |
# File 'app/services/spree_cm_commissioner/integrations/stadium_x_v1/resources/ticket.rb', line 4 def generated_by @generated_by end |
#is_expired ⇒ Object
Returns the value of attribute is_expired.
4 5 6 |
# File 'app/services/spree_cm_commissioner/integrations/stadium_x_v1/resources/ticket.rb', line 4 def is_expired @is_expired end |
#is_online ⇒ Object
Returns the value of attribute is_online.
4 5 6 |
# File 'app/services/spree_cm_commissioner/integrations/stadium_x_v1/resources/ticket.rb', line 4 def is_online @is_online end |
#is_used ⇒ Object
Returns the value of attribute is_used.
4 5 6 |
# File 'app/services/spree_cm_commissioner/integrations/stadium_x_v1/resources/ticket.rb', line 4 def is_used @is_used end |
#league_id ⇒ Object
Returns the value of attribute league_id.
4 5 6 |
# File 'app/services/spree_cm_commissioner/integrations/stadium_x_v1/resources/ticket.rb', line 4 def league_id @league_id end |
#match_id ⇒ Object
Returns the value of attribute match_id.
4 5 6 |
# File 'app/services/spree_cm_commissioner/integrations/stadium_x_v1/resources/ticket.rb', line 4 def match_id @match_id end |
#payment_method ⇒ Object
Returns the value of attribute payment_method.
4 5 6 |
# File 'app/services/spree_cm_commissioner/integrations/stadium_x_v1/resources/ticket.rb', line 4 def payment_method @payment_method end |
#remark ⇒ Object
Returns the value of attribute remark.
4 5 6 |
# File 'app/services/spree_cm_commissioner/integrations/stadium_x_v1/resources/ticket.rb', line 4 def remark @remark end |
#ticket_type ⇒ Object
Returns the value of attribute ticket_type.
4 5 6 |
# File 'app/services/spree_cm_commissioner/integrations/stadium_x_v1/resources/ticket.rb', line 4 def ticket_type @ticket_type end |
#token_id ⇒ Object
Returns the value of attribute token_id.
4 5 6 |
# File 'app/services/spree_cm_commissioner/integrations/stadium_x_v1/resources/ticket.rb', line 4 def token_id @token_id end |
#uid ⇒ Object
Returns the value of attribute uid.
4 5 6 |
# File 'app/services/spree_cm_commissioner/integrations/stadium_x_v1/resources/ticket.rb', line 4 def uid @uid end |
#updated_at ⇒ Object
Returns the value of attribute updated_at.
4 5 6 |
# File 'app/services/spree_cm_commissioner/integrations/stadium_x_v1/resources/ticket.rb', line 4 def updated_at @updated_at end |
#used_at ⇒ Object
Returns the value of attribute used_at.
4 5 6 |
# File 'app/services/spree_cm_commissioner/integrations/stadium_x_v1/resources/ticket.rb', line 4 def used_at @used_at end |
#zone_id ⇒ Object
Returns the value of attribute zone_id.
4 5 6 |
# File 'app/services/spree_cm_commissioner/integrations/stadium_x_v1/resources/ticket.rb', line 4 def zone_id @zone_id end |
Instance Method Details
#to_h ⇒ Object
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'app/services/spree_cm_commissioner/integrations/stadium_x_v1/resources/ticket.rb', line 36 def to_h { _id: _id, match_id: match_id, uid: uid, first_uid: first_uid, generated_by: generated_by, club_id: club_id, zone_id: zone_id, league_id: league_id, token_id: token_id, payment_method: payment_method, ticket_type: ticket_type, remark: remark, is_used: is_used, is_online: is_online, used_at: used_at&.iso8601, is_expired: is_expired, created_at: created_at&.iso8601, updated_at: updated_at&.iso8601, cashback: cashback, __v: __v }.compact end |