Class: KaleidoscopeCommand

Inherits:
Object
  • Object
show all
Defined in:
lib/second_curtain/kaleidoscope_command.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(before_path, after_path) ⇒ KaleidoscopeCommand

Returns a new instance of KaleidoscopeCommand.



13
14
15
16
# File 'lib/second_curtain/kaleidoscope_command.rb', line 13

def initialize(before_path, after_path)
  @before_path = before_path
  @after_path = after_path
end

Instance Attribute Details

#after_pathObject

Returns the value of attribute after_path.



4
5
6
# File 'lib/second_curtain/kaleidoscope_command.rb', line 4

def after_path
  @after_path
end

#before_pathObject

Returns the value of attribute before_path.



3
4
5
# File 'lib/second_curtain/kaleidoscope_command.rb', line 3

def before_path
  @before_path
end

#failsObject

Returns the value of attribute fails.



2
3
4
# File 'lib/second_curtain/kaleidoscope_command.rb', line 2

def fails
  @fails
end

Class Method Details

.command_from_line(line) ⇒ Object



6
7
8
9
10
11
# File 'lib/second_curtain/kaleidoscope_command.rb', line 6

def self.command_from_line(line)
  components = line.split("\"")
  if components.count >= 4
    KaleidoscopeCommand.new(components[1], components[3])
  end
end