Class: HostConnect::Translation

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

Overview

Translate to/from HostConnect codes

Constant Summary collapse

GRAMMAR =
{
  "SG"   => "Single",
  "TW"   => "Twin",
  "DB"   => "Double",
  "TR"   => "Triple",
  "QD"   => "Quad",
  "CF"   => "Confirmed",
  "CX"   => "Cancelled",
  "FQ"   => "FIT Quote",
  "IN"   => "Internet Booking",
  "RQ"   => "Request",
  "CRCD" => "Credit Card Payment"
}

Class Method Summary collapse

Class Method Details

.translate(string) ⇒ Object



18
19
20
# File 'lib/hostconnect/translation.rb', line 18

def self.translate(string)
  (string =~ /^[A-Z]{2}$/) ? GRAMMAR[string] : GRAMMAR.invert[string]
end