Class: Irwi::Comparators::Spans::ChangedSpan

Inherits:
Object
  • Object
show all
Defined in:
lib/irwi/comparators/spans/changed_span.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#actionObject

Returns the value of attribute action.



3
4
5
# File 'lib/irwi/comparators/spans/changed_span.rb', line 3

def action
  @action
end

#new_valueObject

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_valueObject

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_sObject



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