Class: DictClient::KeyValueResponse

Inherits:
SimpleResponse show all
Includes:
Formattable
Defined in:
lib/dict_client/responses.rb

Instance Method Summary collapse

Methods included from Formattable

#longest, #print_formatted

Methods inherited from SimpleResponse

#initialize

Constructor Details

This class inherits a constructor from DictClient::SimpleResponse

Instance Method Details

#to_hObject



51
52
53
# File 'lib/dict_client/responses.rb', line 51

def to_h
  @table
end

#to_sObject



55
56
57
58
59
60
61
# File 'lib/dict_client/responses.rb', line 55

def to_s
  max_value = longest @table.values
  max_key =   longest @table.keys

  print_formatted @table, max_key, max_value

end