Class: DictClient::WordDefinitions::WordDefinition

Inherits:
Struct
  • Object
show all
Defined in:
lib/dict_client/responses.rb

Constant Summary collapse

BAR =
('-' * 76) + "\n"

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#definitionObject

Returns the value of attribute definition

Returns:

  • (Object)

    the current value of definition



118
119
120
# File 'lib/dict_client/responses.rb', line 118

def definition
  @definition
end

#dictionary_descriptionObject

Returns the value of attribute dictionary_description

Returns:

  • (Object)

    the current value of dictionary_description



118
119
120
# File 'lib/dict_client/responses.rb', line 118

def dictionary_description
  @dictionary_description
end

#dictionary_nameObject

Returns the value of attribute dictionary_name

Returns:

  • (Object)

    the current value of dictionary_name



118
119
120
# File 'lib/dict_client/responses.rb', line 118

def dictionary_name
  @dictionary_name
end

#wordObject

Returns the value of attribute word

Returns:

  • (Object)

    the current value of word



118
119
120
# File 'lib/dict_client/responses.rb', line 118

def word
  @word
end

Instance Method Details

#to_s(n = nil) ⇒ Object



122
123
124
125
126
# File 'lib/dict_client/responses.rb', line 122

def to_s(n = nil)
  (n.nil? ? '' : "#{n}) ") +
  "#{dictionary_name} (#{dictionary_description}): #{word}\n" +
  BAR + definition + BAR
end