class DictClient::WordMatch

Attributes

matches[R]

Public Instance Methods

count() click to toggle source
# File lib/dict_client/responses.rb, line 93
def count
  @matches.size
end
to_s() click to toggle source
# File lib/dict_client/responses.rb, line 86
def to_s
  max_key   = longest @matches.map{|tuple| tuple[0] }
  max_value = longest @matches.map{|tuple| tuple[1] }

  print_formatted @matches, max_key, max_value
end

Private Instance Methods

process_line(line) click to toggle source
# File lib/dict_client/responses.rb, line 99
def process_line line
  @matches ||= []

  if line =~ /^([^\s]+)\s+"([^"]+)"/
    @matches << [$1, $2]
  end
end