class Differin::Renderers::Text

Attributes

current_row[RW]

Getters/Setters

string[RW]

Getters/Setters

Public Instance Methods

render() click to toggle source
# File lib/differin/renderers/text.rb, line 12
def render
  self.string = ''

  print_header
  print_body
  print_footer

  string
end

Private Instance Methods

line_color() click to toggle source
# File lib/differin/renderers/text.rb, line 46
def line_color
  case current_row[:status]
  when Differin::MODIFIED
    :yellow
  when Differin::ADDED
    :green
  when Differin::REMOVED
    :red
  else
    {}
  end
end
line_prefix() click to toggle source
# File lib/differin/renderers/text.rb, line 59
def line_prefix
  case current_row[:status]
  when Differin::MODIFIED
    '*'
  when Differin::ADDED
    '+'
  when Differin::REMOVED
    '-'
  when Differin::EQUAL
    '='
  else
    ' '
  end
end
line_text() click to toggle source
# File lib/differin/renderers/text.rb, line 74
def line_text
  case current_row[:status]
  when Differin::MODIFIED
    "#{current_row[:values].first}|#{current_row[:values].last}"
  else
    current_row[:values].first || current_row[:values].last
  end
end
print_body() click to toggle source
print_header() click to toggle source