Class: CallType
- Inherits:
-
Object
- Object
- CallType
- Defined in:
- lib/tbr/call_type.rb
Instance Method Summary collapse
- #desc(code) ⇒ Object
-
#initialize ⇒ CallType
constructor
A new instance of CallType.
- #load(filename) ⇒ Object
- #size ⇒ Object
Constructor Details
#initialize ⇒ CallType
3 4 5 |
# File 'lib/tbr/call_type.rb', line 3 def initialize @types = Hash.new end |
Instance Method Details
#desc(code) ⇒ Object
20 21 22 |
# File 'lib/tbr/call_type.rb', line 20 def desc(code) @types[code] ? @types[code] : "Unknown service type - " + code end |
#load(filename) ⇒ Object
7 8 9 10 11 12 13 14 |
# File 'lib/tbr/call_type.rb', line 7 def load(filename) file = File.new(filename) @types = Hash.new file.each_line do |line| fields = line.split(',') @types[fields[1]] = fields[3] if fields[0] == 'TC' end end |
#size ⇒ Object
16 17 18 |
# File 'lib/tbr/call_type.rb', line 16 def size @types.size end |