lib/env_compat.rb in env_compat-0.1.0 vs lib/env_compat.rb in env_compat-0.1.1
- old
+ new
@@ -1,8 +1,16 @@
require "env_compat/version"
module EnvCompat
class << self
+ def auto tag, str
+ if str[/#{tag}_/i]
+ decode str[tag.length.+(1)..-1]
+ else
+ "#{tag.upcase}_#{encode str}"
+ end
+ end
+
def encode str
builder = ''
_ = CodeBlock.new
str.chars.each do |chr|
case chr