Sha256: 75e69c878898f012e8e51f8232e719cebeba0b5700ae57d4532ca5c52c85fd82
Contents?: true
Size: 577 Bytes
Versions: 1
Compression:
Stored size: 577 Bytes
Contents
module Lingo24 # Model class for the Language's returned from the Lingo24 Translation APIs. class Language attr_reader :code, :name # Creates a new +Language+. # # Parameters: # <tt>code</tt> - a string containing the ISO-639-1 code for the language. # <tt>name</tt> - a string containing the friendly name for the language. def initialize(code, name) @code = code @name = name end # Overrides default +to_s+ to return a friendly display of the object. def to_s "(" + code + ": " + name + ")" end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
lingo24-0.1.0 | lib/lingo24/language.rb |