Class: Enumerator::ArithmeticSequence

Inherits:
Object
  • Object
show all
Defined in:
lib/report_print/core_extensions.rb

Instance Method Summary collapse

Instance Method Details

#report_print(rp) ⇒ Object



86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# File 'lib/report_print/core_extensions.rb', line 86

def report_print(rp)
  rp.inline("") do
    rp.write("(")
    unless self.begin.nil?
      rp.rp(self.begin)
    end
    rp.write("..")
    if exclude_end?
      rp.write(".")
    end
    unless self.end.nil?
      rp.rp(self.end)
    end
    rp.write(")")
    unless step == 1
      rp.write(".step(")
      rp.rp(step)
      rp.write(")")
    end
  end
end