Sha256: 3f77f191fca1e97df441ac66bec4dca3eee775e1f1fad35d6932030be446c71e

Contents?: true

Size: 317 Bytes

Versions: 8

Compression:

Stored size: 317 Bytes

Contents

# -*- encoding : utf-8 -*-
module Phrase::Extensions::String
  extend ActiveSupport::Concern
  
  module InstanceMethods
    def expand_to_hash(value=nil)
      self.split('.').reverse.inject(value) do |hash, item|
        {item => hash}
      end
    end
  end
end

String.send(:include, Phrase::Extensions::String)

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
phrase-0.0.8 lib/phrase/extensions/string.rb
phrase-0.0.7 lib/phrase/extensions/string.rb
phrase-0.0.6 lib/phrase/extensions/string.rb
phrase-0.0.5 lib/phrase/extensions/string.rb
phrase-0.0.4 lib/phrase/extensions/string.rb
phrase-0.0.3 lib/phrase/extensions/string.rb
phrase-0.0.2 lib/phrase/extensions/string.rb
phrase-0.0.1 lib/phrase/extensions/string.rb