class SFCRoom::Room

Attributes

building[R]
floor[R]
room[R]
source[R]

Public Class Methods

new(opts={}) click to toggle source
# File lib/sfc-room/room.rb, line 2
def initialize(opts={})
  {:building => nil, :room => nil, :floor => nil, :source => nil}.each do |k,v|
    opts[k] = v unless opts.has_key? k
  end
  raise ArgumentError, "building must be String" unless opts[:building]
  @building = opts[:building]
  @room = opts[:room]
  @floor = opts[:floor]
  @source = opts[:source]
end

Public Instance Methods

building_in_greek() click to toggle source
# File lib/sfc-room/room.rb, line 30
def building_in_greek
  SFCRoom::Buildings::GreekChar[@building] || SFCRoom::Buildings::JapaneseName[@building]
end
building_in_japanese() click to toggle source
# File lib/sfc-room/room.rb, line 27
def building_in_japanese
  SFCRoom::Buildings::JapaneseName[@building]
end
building_in_roman() click to toggle source
# File lib/sfc-room/room.rb, line 33
def building_in_roman
  SFCRoom::Buildings::RomanChar[@building] || SFCRoom::Buildings::JapaneseName[@building]
end
building_number_for_sfs() click to toggle source
# File lib/sfc-room/room.rb, line 36
def building_number_for_sfs
  SFCRoom::Buildings::SFSNumber[@building] || SFCRoom::Buildings::SFSNumber[SFCRoom::Buildings::Others]
end
inspect() click to toggle source
# File lib/sfc-room/room.rb, line 12
def inspect
  "[SFCRoom #{to_roman}]"
end
to_greek() click to toggle source
# File lib/sfc-room/room.rb, line 18
def to_greek
  "#{building_in_greek}#{@room}"
end
to_japanese() click to toggle source
# File lib/sfc-room/room.rb, line 24
def to_japanese
  "#{building_in_japanese}#{@room}"
end
to_roman() click to toggle source
# File lib/sfc-room/room.rb, line 21
def to_roman
  "#{building_in_roman}#{@room}"
end
to_s() click to toggle source
# File lib/sfc-room/room.rb, line 15
def to_s
  to_japanese
end