Sha256: 8b130513482717c2800c4532f9e4963abe1fc6d9f38cb9af5a04bd3b937485b7

Contents?: true

Size: 970 Bytes

Versions: 3

Compression:

Stored size: 970 Bytes

Contents

# encoding: UTF-8

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

module TwitterCldr
  module Js
    module Renderers
      module Numbers
        class NumbersRenderer < TwitterCldr::Js::Renderers::Base
          self.template_file = File.expand_path(File.join(File.dirname(__FILE__), "../..", "mustache/numbers/numbers.coffee"))

          def tokens
            TwitterCldr::Tokenizers::NumberTokenizer::VALID_TYPES.inject({}) do |ret, type|
              tokenizer = TwitterCldr::Tokenizers::NumberTokenizer.new(:type => type, :locale => @locale)
              ret[type] = {}
              [:positive, :negative].each do |sign|
                ret[type][sign] = tokenizer.tokens(:sign => sign)
              end
              ret
            end.to_json
          end

          def symbols
            TwitterCldr::Tokenizers::NumberTokenizer.new(:locale => @locale).symbols.to_json
          end
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
twitter_cldr_js-1.0.0 lib/twitter_cldr/js/renderers/numbers/numbers_renderer.rb
twitter_cldr-1.8.0 js/lib/renderers/numbers/numbers_renderer.rb
twitter_cldr-1.7.0 js/lib/renderers/numbers/numbers_renderer.rb