Class: Quarry::Spec::Comment

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

Overview

Comment

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(parent, text, lineno) ⇒ Comment

Returns a new instance of Comment.



59
60
61
62
63
# File 'lib/quarry/spec/step.rb', line 59

def initialize(parent, text, lineno)
  @parent = parent
  @text   = text.strip
  @lineno = lineno
end

Instance Attribute Details

#linenoObject (readonly)

Returns the value of attribute lineno.



57
58
59
# File 'lib/quarry/spec/step.rb', line 57

def lineno
  @lineno
end

#parentObject (readonly) Also known as: spec

Returns the value of attribute parent.



55
56
57
# File 'lib/quarry/spec/step.rb', line 55

def parent
  @parent
end

#textObject (readonly) Also known as: description

Returns the value of attribute text.



56
57
58
# File 'lib/quarry/spec/step.rb', line 56

def text
  @text
end

Instance Method Details

#typeObject Also known as: macro?



69
70
71
72
# File 'lib/quarry/spec/step.rb', line 69

def type
  /^(\w{1,9})[:]/i =~ text
  $1.downcase.to_sym if $1
end