Sha256: 143b0964dc3de6ad6bd0a26deb787cd4df91eb630900089687311294022b2350

Contents?: true

Size: 294 Bytes

Versions: 8

Compression:

Stored size: 294 Bytes

Contents

module SmallCage
  module LangHelper

    def lang
      return @obj["lang"] unless @obj["lang"].nil?

      if @obj["uri"] =~ %r{^/(ja|en)/}
        return $1
      end

      return nil
    end

    def switch_lang(code)
      @obj["uri"].gsub(%r{^/(en|ja)/}, "/#{code}/")
    end

  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
smallcage-0.3.2 project/lang/_smc/helpers/lang_helper.rb
smallcage-0.3.1 project/lang/_smc/helpers/lang_helper.rb
smallcage-0.3.0 project/lang/_smc/helpers/lang_helper.rb
smallcage-0.2.9 project/lang/_smc/helpers/lang_helper.rb
smallcage-0.2.8 project/lang/_smc/helpers/lang_helper.rb
smallcage-0.2.7 project/lang/_smc/helpers/lang_helper.rb
smallcage-0.2.6 project/lang/_smc/helpers/lang_helper.rb
smallcage-0.2.5 project/lang/_smc/helpers/lang_helper.rb