Module: Duxml::Change
- Included in:
- ChangeClass
- Defined in:
- lib/duxml/meta/history/change.rb,
lib/duxml/meta/history/change.rb
Overview
class ChangeClass < PatternClass
Instance Method Summary collapse
-
#<=>(obj) ⇒ -1, ...
Compares dates of changes.
- #abstract? ⇒ Boolean
-
#description ⇒ String
Gives its time stamp.
-
#line ⇒ Fixnum
Line number of changed object; -l if not applicable.
Instance Method Details
#<=>(obj) ⇒ -1, ...
Returns compares dates of changes.
43 44 45 46 |
# File 'lib/duxml/meta/history/change.rb', line 43 def <=>(obj) return nil unless obj.is_a?(Duxml::Change) date <=> obj.date end |
#abstract? ⇒ Boolean
33 34 35 |
# File 'lib/duxml/meta/history/change.rb', line 33 def abstract? false end |
#description ⇒ String
Returns gives its time stamp.
38 39 40 |
# File 'lib/duxml/meta/history/change.rb', line 38 def description "at #{time_stamp}#{line_expr}:" end |
#line ⇒ Fixnum
Returns line number of changed object; -l if not applicable.
49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/duxml/meta/history/change.rb', line 49 def line case when object.respond_to?(:line) && object.line.is_a?(Numeric) && object.line >= 0 object.line when object.respond_to?(:object) && object.object.respond_to?(:line) && object.object.line.is_a?(Numeric) && object.object.line >= 0 object.object.line when object.respond_to?(:subject) && object.subject.respond_to?(:line) && object.subject.line.is_a?(Numeric) && object.subject.line >= 0 object.subject.line when subject.respond_to?(:line) && subject.line.is_a?(Numeric) && subject.line >= 0 subject.line else -1 end end |