Class: DictClient::WordDefinitions
- Inherits:
-
SimpleResponse
- Object
- SimpleResponse
- DictClient::WordDefinitions
- Defined in:
- lib/dict_client/responses.rb
Defined Under Namespace
Classes: WordDefinition
Instance Attribute Summary collapse
-
#definitions ⇒ Object
readonly
Returns the value of attribute definitions.
Instance Method Summary collapse
- #count ⇒ Object
-
#initialize(lines) ⇒ WordDefinitions
constructor
A new instance of WordDefinitions.
- #to_s ⇒ Object
Constructor Details
#initialize(lines) ⇒ WordDefinitions
Returns a new instance of WordDefinitions.
113 114 115 116 |
# File 'lib/dict_client/responses.rb', line 113 def initialize lines @definitions = [] super(lines) end |
Instance Attribute Details
#definitions ⇒ Object (readonly)
Returns the value of attribute definitions.
111 112 113 |
# File 'lib/dict_client/responses.rb', line 111 def definitions @definitions end |
Instance Method Details
#count ⇒ Object
134 135 136 |
# File 'lib/dict_client/responses.rb', line 134 def count @definitions.size end |
#to_s ⇒ Object
130 131 132 |
# File 'lib/dict_client/responses.rb', line 130 def to_s @definitions.each_with_index.to_a.map{|definition, idx| definition.to_s(idx+1)}.join end |