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.



12
13
14
15
16
17
# File 'lib/uec_express_api.rb', line 12

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.



9
10
11
# File 'lib/uec_express_api.rb', line 9

def express=(value)
  @express = value
end

#updated=(value) ⇒ Object

Sets the attribute updated

Parameters:

  • value

    the value to set the attribute updated to.



9
10
11
# File 'lib/uec_express_api.rb', line 9

def updated=(value)
  @updated = value
end

Instance Method Details

#to_hashObject



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

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

#to_json(*args) ⇒ Object



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

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

#to_sObject



30
31
32
33
34
35
36
37
38
# File 'lib/uec_express_api.rb', line 30

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