Class: UECExpressApi
- Inherits:
-
Object
- Object
- UECExpressApi
- Defined in:
- lib/uec_express_api.rb
Constant Summary collapse
- @@debug =
false
Instance Attribute Summary collapse
-
#express ⇒ Object
writeonly
Sets the attribute express.
-
#updated ⇒ Object
writeonly
Sets the attribute updated.
Instance Method Summary collapse
-
#initialize ⇒ UECExpressApi
constructor
A new instance of UECExpressApi.
- #to_hash ⇒ Object
- #to_json(*args) ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize ⇒ UECExpressApi
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
17 18 19 |
# File 'lib/uec_express_api.rb', line 17 def express=(value) @express = value end |
#updated=(value) ⇒ Object
Sets the attribute updated
17 18 19 |
# File 'lib/uec_express_api.rb', line 17 def updated=(value) @updated = value end |
Instance Method Details
#to_hash ⇒ Object
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_s ⇒ Object
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 |