Class: Shaf::Command::Test::RunnableMethod

Inherits:
Object
  • Object
show all
Defined in:
lib/shaf/command/test/runnable_method.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(runnable, name, line) ⇒ RunnableMethod

Returns a new instance of RunnableMethod.



14
15
16
17
18
# File 'lib/shaf/command/test/runnable_method.rb', line 14

def initialize(runnable, name, line)
  @runnable = runnable
  @name = name
  @line = line
end

Instance Attribute Details

#lineObject (readonly)

Returns the value of attribute line.



7
8
9
# File 'lib/shaf/command/test/runnable_method.rb', line 7

def line
  @line
end

#nameObject (readonly)

Returns the value of attribute name.



7
8
9
# File 'lib/shaf/command/test/runnable_method.rb', line 7

def name
  @name
end

#runnableObject (readonly)

Returns the value of attribute runnable.



7
8
9
# File 'lib/shaf/command/test/runnable_method.rb', line 7

def runnable
  @runnable
end

Class Method Details

.from(runnable, method_name) ⇒ Object



9
10
11
12
# File 'lib/shaf/command/test/runnable_method.rb', line 9

def self.from(runnable, method_name)
  _, line = runnable.instance_method(method_name).source_location
  new(runnable, method_name, line)
end