Class: Reddy::Literal::Language
- Inherits:
-
Object
- Object
- Reddy::Literal::Language
- Defined in:
- lib/reddy/literal.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #clean(string) ⇒ Object
-
#initialize(string) ⇒ Language
constructor
A new instance of Language.
- #to_s ⇒ Object
Constructor Details
#initialize(string) ⇒ Language
Returns a new instance of Language.
208 209 210 |
# File 'lib/reddy/literal.rb', line 208 def initialize(string) @value = string.to_s.downcase end |
Instance Attribute Details
#value ⇒ Object
Returns the value of attribute value.
207 208 209 |
# File 'lib/reddy/literal.rb', line 207 def value @value end |
Instance Method Details
#==(other) ⇒ Object
219 220 221 222 223 224 225 226 |
# File 'lib/reddy/literal.rb', line 219 def == (other) case other when String other == @value when self.class other.value == @value end end |
#clean(string) ⇒ Object
212 213 214 215 216 217 |
# File 'lib/reddy/literal.rb', line 212 def clean(string) case string when "eng"; "en" else string end end |
#to_s ⇒ Object
228 |
# File 'lib/reddy/literal.rb', line 228 def to_s; @value; end |