Class: Ovchipkaart::Api

Inherits:
Object
  • Object
show all
Defined in:
lib/ovchipkaart/api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeApi

Returns a new instance of Api.



6
7
8
# File 'lib/ovchipkaart/api.rb', line 6

def initialize
  @parser = parse_transactions
end

Instance Attribute Details

#parserObject (readonly)

Returns the value of attribute parser.



4
5
6
# File 'lib/ovchipkaart/api.rb', line 4

def parser
  @parser
end

Instance Method Details

#additionsObject



30
31
32
# File 'lib/ovchipkaart/api.rb', line 30

def additions
  parser.additions
end

#balanceObject



10
11
12
# File 'lib/ovchipkaart/api.rb', line 10

def balance
  balance_and_date[:balance]
end

#checkinsObject



22
23
24
# File 'lib/ovchipkaart/api.rb', line 22

def checkins
  parser.check_ins
end

#forgotten_checkoutsObject



26
27
28
# File 'lib/ovchipkaart/api.rb', line 26

def forgotten_checkouts
  parser.forgotten_check_outs
end

#journeysObject



18
19
20
# File 'lib/ovchipkaart/api.rb', line 18

def journeys
  parser.journeys
end

#last_updatedObject



14
15
16
# File 'lib/ovchipkaart/api.rb', line 14

def last_updated
  balance_and_date[:date]
end

#productsObject



34
35
36
# File 'lib/ovchipkaart/api.rb', line 34

def products
  parser.products
end

#unclassifiedObject



38
39
40
# File 'lib/ovchipkaart/api.rb', line 38

def unclassified
  parser.others
end