Class: Cucumberator::StepLine

Inherits:
Object
  • Object
show all
Defined in:
lib/cucumberator/step_line.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(line) ⇒ StepLine

Returns a new instance of StepLine.



5
6
7
# File 'lib/cucumberator/step_line.rb', line 5

def initialize(line)
  @number = line.to_i
end

Instance Attribute Details

#numberObject

Returns the value of attribute number.



3
4
5
# File 'lib/cucumberator/step_line.rb', line 3

def number
  @number
end

Instance Method Details

#+(other) ⇒ Object



13
14
15
# File 'lib/cucumberator/step_line.rb', line 13

def +(other)
  number + other.to_i
end

#-(other) ⇒ Object



9
10
11
# File 'lib/cucumberator/step_line.rb', line 9

def -(other)
  number - other.to_i
end

#decrement!Object



25
26
27
# File 'lib/cucumberator/step_line.rb', line 25

def decrement!
  self.number -= 1
end

#increment!Object



21
22
23
# File 'lib/cucumberator/step_line.rb', line 21

def increment!
  self.number += 1
end

#set(other) ⇒ Object



17
18
19
# File 'lib/cucumberator/step_line.rb', line 17

def set(other)
  self.number = other.to_i
end