# -*- 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)