Class: UECExpressApi

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

Constant Summary collapse

@@debug =
false

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeUECExpressApi

Returns a new instance of UECExpressApi.



20
21
22
23
24
25
# File 'lib/uec_express_api.rb', line 20

def initialize()

    @updated = ""
    @express = Array.new
    parse_UEC_express()
end

Instance Attribute Details

#express=(value) ⇒ Object

Sets the attribute express

Parameters:

  • value

    the value to set the attribute express to.



17
18
19
# File 'lib/uec_express_api.rb', line 17

def express=(value)
  @express = value
end

#updated=(value) ⇒ Object

Sets the attribute updated

Parameters:

  • value

    the value to set the attribute updated to.



17
18
19
# File 'lib/uec_express_api.rb', line 17

def updated=(value)
  @updated = value
end

Instance Method Details

#to_hashObject



27
28
29
30
31
32
# File 'lib/uec_express_api.rb', line 27

def to_hash
    {
        :express => @express,
        :updated => @updated
    }
end

#to_json(*args) ⇒ Object



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

def to_json(*args)
    to_hash().to_json(*args)
end

#to_sObject



38
39
40
41
42
43
44
45
46
# File 'lib/uec_express_api.rb', line 38

def to_s()
    puts "-------------------------------------------------------------"
    puts "| class | data | time | subject | staff | remark |"
    @express.each do |ex|
        puts "| " + ex[:class].to_s + " | " + ex[:data].to_s + " | " + ex[:data].to_s + " | " + ex[:subject].to_s + " | " + ex[:staff].to_s + " | " + ex[:remark].to_s + " |"
    end
    puts "Last Updated :" + @updated
    puts "-------------------------------------------------------------"
end