Class: TableBeet::Step

Inherits:
Object
  • Object
show all
Defined in:
lib/table_beet/step.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(method) ⇒ Step

Returns a new instance of Step.



8
9
10
11
12
# File 'lib/table_beet/step.rb', line 8

def initialize(method)
  @method = method
  @name   = method.name.to_s
  @file, @lineno = method.source_location
end

Instance Attribute Details

#fileObject (readonly)

Returns the value of attribute file.



6
7
8
# File 'lib/table_beet/step.rb', line 6

def file
  @file
end

#linenoObject (readonly)

Returns the value of attribute lineno.



6
7
8
# File 'lib/table_beet/step.rb', line 6

def lineno
  @lineno
end

#nameObject (readonly)

Returns the value of attribute name.



6
7
8
# File 'lib/table_beet/step.rb', line 6

def name
  @name
end

Instance Method Details

#idObject



14
15
16
# File 'lib/table_beet/step.rb', line 14

def id
  @method.hash
end

#locationObject



22
23
24
# File 'lib/table_beet/step.rb', line 22

def location
  File.expand_path(@file) + ":" + @lineno.to_s
end

#sourceObject



18
19
20
# File 'lib/table_beet/step.rb', line 18

def source
  @method.comment + @method.source
end