summaryrefslogtreecommitdiff
path: root/lib/oxidized/model/model.rb
diff options
context:
space:
mode:
authorSaku Ytti <saku@ytti.fi>2014-04-15 21:27:54 +0300
committerSaku Ytti <saku@ytti.fi>2014-04-15 21:27:54 +0300
commitff15057823db09509f76512d59ed87c316d882dc (patch)
tree8fd8bd4d7bee41e76dc76ebc9275be5431c11232 /lib/oxidized/model/model.rb
parent8abe0b299990fba0e12875634368922abe2710df (diff)
Use String subclass in model#cmd
Will allow convenience methods such as cmd :all do |cfg| cfg.pop.shift end instead of: cmd :all do |cfg| cfg.each_line.to_a[1..-2].join end And what ever convenience configs we come up with
Diffstat (limited to 'lib/oxidized/model/model.rb')
-rw-r--r--lib/oxidized/model/model.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/oxidized/model/model.rb b/lib/oxidized/model/model.rb
index ca08332..dc7d18a 100644
--- a/lib/oxidized/model/model.rb
+++ b/lib/oxidized/model/model.rb
@@ -76,6 +76,7 @@ module Oxidized
def cmd string, &block
out = @input.cmd string
return false unless out
+ out = Oxidized::String out
self.class.cmds[:all].each do |all_block|
out = instance_exec out, string, &all_block
end