Module: Perception::TimeI
- Included in:
- Time
- Defined in:
- lib/perception/date_and_time.rb
Using inspect_see for to_s and pretty_print collapse
Instance Method Details
#inspect_see(options = {}) ⇒ String
21 22 23 24 25 26 27 28 29 |
# File 'lib/perception/date_and_time.rb', line 21 def inspect_see(={}) norm = [:norm] || :iso precision_max = 4 precision = [:precision] || precision_max precision = 0 if precision < 0 precision = precision_max if precision > precision_max formatstring = TIME_FORMATS[norm][precision] self.strftime(formatstring) end |
#pretty_print(q) ⇒ String
40 41 42 |
# File 'lib/perception/date_and_time.rb', line 40 def pretty_print(q) q.text(self.inspect_see(:precision => 5)) end |
#to_s ⇒ String
34 35 36 |
# File 'lib/perception/date_and_time.rb', line 34 def to_s self.inspect_see(:precision => 5) end |