Class: Mayl::Commands::Ls

Inherits:
Object
  • Object
show all
Defined in:
lib/mayl/commands/ls.rb

Overview

Public: The Cd command navigates through YAML namespaces.

Example

command = Ls.new(env)
command.execute

Instance Method Summary collapse

Constructor Details

#initialize(env) ⇒ Ls

Public: Initializes a new Cd command.

env - the global environment



14
15
16
# File 'lib/mayl/commands/ls.rb', line 14

def initialize(env)
  @env = env
end

Instance Method Details

#executeObject

Public: Adds the path to the namespace.

Returns nil.



21
22
23
24
25
26
# File 'lib/mayl/commands/ls.rb', line 21

def execute
  @env.peek.each do |option|
    print "#{option} "
  end
  nil
end