Class: TwitterCldr::Formatters::Rbnf::Substitution
- Inherits:
-
Struct
- Object
- Struct
- TwitterCldr::Formatters::Rbnf::Substitution
- Defined in:
- lib/twitter_cldr/formatters/numbers/rbnf/substitution.rb
Instance Attribute Summary collapse
-
#contents ⇒ Object
Returns the value of attribute contents.
-
#length ⇒ Object
Returns the value of attribute length.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
Instance Attribute Details
#contents ⇒ Object
Returns the value of attribute contents
10 11 12 |
# File 'lib/twitter_cldr/formatters/numbers/rbnf/substitution.rb', line 10 def contents @contents end |
#length ⇒ Object
Returns the value of attribute length
10 11 12 |
# File 'lib/twitter_cldr/formatters/numbers/rbnf/substitution.rb', line 10 def length @length end |
#type ⇒ Object
Returns the value of attribute type
10 11 12 |
# File 'lib/twitter_cldr/formatters/numbers/rbnf/substitution.rb', line 10 def type @type end |
Instance Method Details
#decimal_format ⇒ Object
21 22 23 24 25 |
# File 'lib/twitter_cldr/formatters/numbers/rbnf/substitution.rb', line 21 def decimal_format if item = contents.first item.value if item.type == :decimal end end |
#description ⇒ Object
11 12 13 |
# File 'lib/twitter_cldr/formatters/numbers/rbnf/substitution.rb', line 11 def description @description ||= contents.map(&:value).join end |
#rule_set_reference ⇒ Object
15 16 17 18 19 |
# File 'lib/twitter_cldr/formatters/numbers/rbnf/substitution.rb', line 15 def rule_set_reference if item = contents.first item.value.gsub("%", "") if item.type == :rule end end |