Class: Range

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

Instance Method Summary collapse

Instance Method Details

#report_print(rp) ⇒ Object



62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# File 'lib/report_print/core_extensions.rb', line 62

def report_print(rp)
  first = self.first rescue nil
  last = self.last rescue nil

  rp.inline("") do
    rp.write("(")
    unless first.nil?
      rp.rp(first)
    end
    rp.write("..")
    if exclude_end?
      rp.write(".")
    end
    unless last.nil?
      rp.rp(last)
    end
    rp.write(")")
  end
end