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.



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

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.



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

def file
  @file
end

#linenoObject (readonly)

Returns the value of attribute lineno.



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

def lineno
  @lineno
end

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
end

Instance Method Details

#idObject



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

def id
  @method.hash
end

#locationObject



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

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

#sourceObject



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

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