Class: Irwi::Comparators::Spans::ChangedSpan
- Inherits:
-
Object
- Object
- Irwi::Comparators::Spans::ChangedSpan
- Defined in:
- lib/irwi/comparators/spans/changed_span.rb
Instance Attribute Summary collapse
-
#action ⇒ Object
Returns the value of attribute action.
-
#new_value ⇒ Object
Returns the value of attribute new_value.
-
#old_value ⇒ Object
Returns the value of attribute old_value.
Instance Method Summary collapse
-
#initialize(act, ov, nv) ⇒ ChangedSpan
constructor
A new instance of ChangedSpan.
- #to_s ⇒ Object
Constructor Details
#initialize(act, ov, nv) ⇒ ChangedSpan
Returns a new instance of ChangedSpan.
5 6 7 8 9 |
# File 'lib/irwi/comparators/spans/changed_span.rb', line 5 def initialize( act, ov, nv ) @action = act @old_value = ov @new_value = nv end |
Instance Attribute Details
#action ⇒ Object
Returns the value of attribute action.
3 4 5 |
# File 'lib/irwi/comparators/spans/changed_span.rb', line 3 def action @action end |
#new_value ⇒ Object
Returns the value of attribute new_value.
3 4 5 |
# File 'lib/irwi/comparators/spans/changed_span.rb', line 3 def new_value @new_value end |
#old_value ⇒ Object
Returns the value of attribute old_value.
3 4 5 |
# File 'lib/irwi/comparators/spans/changed_span.rb', line 3 def old_value @old_value end |
Instance Method Details
#to_s ⇒ Object
11 12 13 14 15 16 |
# File 'lib/irwi/comparators/spans/changed_span.rb', line 11 def to_s s = '' s << "<span class=\"removed\">#{@old_value}</span>" if @old_value s << "<span class=\"added\">#{@new_value}</span>" if @new_value s end |