Sha256: 8eeada20462b8761ad07725a74100d699311ab286767527779c85c0842d3a0ee

Contents?: true

Size: 444 Bytes

Versions: 5

Compression:

Stored size: 444 Bytes

Contents

module BabelI18n
  class Base

    attr_accessor :translation

    def initialize(text, key, &block)
      @translation = BabelI18n::Translate.new(text)
      @translation.instance_eval(&block) if block_given?
      @translation.key = key
    end

    def translate
      @translation.translate
    end

    def to(to)
      @translation.to(to)
      self
    end

    def from(from)
      @translation.from(from)
      self
    end

  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
babel_i18n-0.0.6 lib/babel_i18n/base.rb
babel_i18n-0.0.5 lib/babel_i18n/base.rb
babel_i18n-0.0.4 lib/babel_i18n/base.rb
babel_i18n-0.0.3 lib/babel_i18n/base.rb
babel_i18n-0.0.2 lib/babel_i18n/base.rb