Sha256: 485326c227955cf793f2a81843dbdbd09c8489dd528457d22de86560ce86acda

Contents?: true

Size: 360 Bytes

Versions: 17

Compression:

Stored size: 360 Bytes

Contents

require "active_support/core_ext/string/conversions"

module Mundipagg
  class Key
    def initialize(value, prefix = "mun")
      @prefix, @value = prefix, value.to_s
    end

    def to_s
      "#{@prefix}:#{camelize}"
    end

    def camelize
      @value.camelize(format)
    end

    def format
      @prefix == "tns" ? :lower : :upper
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
better-mundipagg-0.2.11 lib/mundipagg/key.rb
better-mundipagg-0.2.10 lib/mundipagg/key.rb
better-mundipagg-0.2.9 lib/mundipagg/key.rb
better-mundipagg-0.2.8 lib/mundipagg/key.rb
better-mundipagg-0.2.7 lib/mundipagg/key.rb
better-mundipagg-0.2.6 lib/mundipagg/key.rb
better-mundipagg-0.2.5 lib/mundipagg/key.rb
better-mundipagg-0.2.4 lib/mundipagg/key.rb
better-mundipagg-0.2.3 lib/mundipagg/key.rb
better-mundipagg-0.2.2 lib/mundipagg/key.rb
better-mundipagg-0.2.1 lib/mundipagg/key.rb
better-mundipagg-0.2.0 lib/mundipagg/key.rb
better-mundipagg-0.1.5 lib/mundipagg/key.rb
better-mundipagg-0.1.3 lib/mundipagg/key.rb
better-mundipagg-0.1.2 lib/mundipagg/key.rb
better-mundipagg-0.1.1 lib/mundipagg/key.rb
better-mundipagg-0.1.0 lib/mundipagg/key.rb