Class: TreeRepl::Cat
Instance Attribute Summary
Attributes inherited from Cmd
Instance Method Summary collapse
- #exec(args) ⇒ Object
- #help ⇒ Object
-
#initialize(repl) ⇒ Cat
constructor
A new instance of Cat.
Constructor Details
#initialize(repl) ⇒ Cat
Returns a new instance of Cat.
134 135 136 |
# File 'lib/treerepl/cmds.rb', line 134 def initialize(repl) super(repl,'cat') end |
Instance Method Details
#exec(args) ⇒ Object
140 141 142 143 144 145 146 147 148 149 150 151 152 153 |
# File 'lib/treerepl/cmds.rb', line 140 def exec(args) if args.empty? STDERR.put 'Required argument' return end args.each do |arg| n = repl.eval_path repl.cur,arg if n.kind_of? NamedNode p n.obj else STDERR.puts "Uh, not with this node #{n}" end end end |
#help ⇒ Object
137 138 139 |
# File 'lib/treerepl/cmds.rb', line 137 def help 'Shows the contents of whatever it is you selected' end |