Class: Fnsapi::Ticket
- Inherits:
-
Object
- Object
- Fnsapi::Ticket
- Defined in:
- lib/fnsapi/ticket.rb
Instance Attribute Summary collapse
-
#amount_cents ⇒ Object
readonly
Returns the value of attribute amount_cents.
-
#fd ⇒ Object
readonly
Returns the value of attribute fd.
-
#fn ⇒ Object
readonly
Returns the value of attribute fn.
-
#pfd ⇒ Object
readonly
Returns the value of attribute pfd.
-
#purchase_date ⇒ Object
readonly
Returns the value of attribute purchase_date.
Instance Method Summary collapse
-
#initialize(object) ⇒ Ticket
constructor
A new instance of Ticket.
Constructor Details
#initialize(object) ⇒ Ticket
Returns a new instance of Ticket.
9 10 11 12 13 14 15 16 17 |
# File 'lib/fnsapi/ticket.rb', line 9 def initialize(object) %i[fn fd pfd amount_cents].each do |field_name| instance_variable_set("@#{field_name}", validated_field_value(object, field_name)) end @purchase_date = validated_field_value(object, :purchase_date) @purchase_date = DateTime.parse(@purchase_date) if @purchase_date.is_a?(String) true end |
Instance Attribute Details
#amount_cents ⇒ Object (readonly)
Returns the value of attribute amount_cents.
7 8 9 |
# File 'lib/fnsapi/ticket.rb', line 7 def amount_cents @amount_cents end |
#fd ⇒ Object (readonly)
Returns the value of attribute fd.
7 8 9 |
# File 'lib/fnsapi/ticket.rb', line 7 def fd @fd end |
#fn ⇒ Object (readonly)
Returns the value of attribute fn.
7 8 9 |
# File 'lib/fnsapi/ticket.rb', line 7 def fn @fn end |
#pfd ⇒ Object (readonly)
Returns the value of attribute pfd.
7 8 9 |
# File 'lib/fnsapi/ticket.rb', line 7 def pfd @pfd end |
#purchase_date ⇒ Object (readonly)
Returns the value of attribute purchase_date.
7 8 9 |
# File 'lib/fnsapi/ticket.rb', line 7 def purchase_date @purchase_date end |