Class: Eggsh::Ls

Inherits:
Array show all
Defined in:
lib/ls.rb

Instance Method Summary collapse

Constructor Details

#initialize(arg = nil) ⇒ Ls

Returns a new instance of Ls.



5
6
7
8
9
10
11
# File 'lib/ls.rb', line 5

def initialize(arg = nil)
  if arg
    super(arg)
  else
    super(Dir['*'])
  end
end

Instance Method Details

#[](arg) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/ls.rb', line 13

def [] arg
  if arg.kind_of? String
    Dir[arg]
  else
    old_bracket arg
  end
end

#old_bracketObject



3
# File 'lib/ls.rb', line 3

alias_method :old_bracket, :[]