Class: Mj::AlternativeFile::Commands::ListCommand

Inherits:
Object
  • Object
show all
Defined in:
lib/mj/alternative_file/commands/list_command.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file, options) ⇒ ListCommand

Returns a new instance of ListCommand.



9
10
11
12
# File 'lib/mj/alternative_file/commands/list_command.rb', line 9

def initialize(file, options)
  @file = CurrentFile.new(file.to_s)
  @options = options
end

Instance Attribute Details

#fileObject (readonly)

Returns the value of attribute file.



7
8
9
# File 'lib/mj/alternative_file/commands/list_command.rb', line 7

def file
  @file
end

Instance Method Details

#debug?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/mj/alternative_file/commands/list_command.rb', line 22

def debug?
  @options[:debug]
end

#exists?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/mj/alternative_file/commands/list_command.rb', line 14

def exists?
  @options[:exists]
end

#typesObject



18
19
20
# File 'lib/mj/alternative_file/commands/list_command.rb', line 18

def types
  @options[:types].to_s.split(",")
end