class Morfo::Tools::BaseKeys
Attributes
input_string[R]
Public Class Methods
new(input_string)
click to toggle source
# File lib/morfo/tools.rb, line 54 def initialize(input_string) @input_string = input_string.nil? ? "" : input_string.dup.freeze end
Public Instance Methods
build()
click to toggle source
# File lib/morfo/tools.rb, line 58 def build keys = input_string.scan(/\%\{([^\}]+)\}/).flatten keys.inject({}) do |hash, key| hash.merge!(key.to_sym => nil) end end