Sha256: 42eafdf5af0f12a95e5f6fa690d72a6c06f60daa2acc9ba9b906ed12c1fda5ff

Contents?: true

Size: 620 Bytes

Versions: 11

Compression:

Stored size: 620 Bytes

Contents

# encoding: UTF-8

# Copyright 2012 Twitter, Inc
# http://www.apache.org/licenses/LICENSE-2.0

module TwitterCldr
  module Formatters
    module Rbnf

      Substitution = Struct.new(:type, :contents, :length) do
        def description
          @description ||= contents.map(&:value).join
        end

        def rule_set_reference
          if item = contents.first
            item.value.gsub("%", "") if item.type == :rule
          end
        end

        def decimal_format
          if item = contents.first
            item.value if item.type == :decimal
          end
        end
      end

    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
twitter_cldr-3.0.10 lib/twitter_cldr/formatters/numbers/rbnf/substitution.rb
twitter_cldr-3.0.9 lib/twitter_cldr/formatters/numbers/rbnf/substitution.rb
twitter_cldr-3.0.8 lib/twitter_cldr/formatters/numbers/rbnf/substitution.rb
twitter_cldr-3.0.7 lib/twitter_cldr/formatters/numbers/rbnf/substitution.rb
twitter_cldr-3.0.6 lib/twitter_cldr/formatters/numbers/rbnf/substitution.rb
twitter_cldr-3.0.5 lib/twitter_cldr/formatters/numbers/rbnf/substitution.rb
twitter_cldr-3.0.4 lib/twitter_cldr/formatters/numbers/rbnf/substitution.rb
twitter_cldr-3.0.3 lib/twitter_cldr/formatters/numbers/rbnf/substitution.rb
twitter_cldr-3.0.2 lib/twitter_cldr/formatters/numbers/rbnf/substitution.rb
twitter_cldr-3.0.1 lib/twitter_cldr/formatters/numbers/rbnf/substitution.rb
twitter_cldr-3.0.0 lib/twitter_cldr/formatters/numbers/rbnf/substitution.rb