Class: OpenDictionary::PartOfSpeech
- Inherits:
-
Object
- Object
- OpenDictionary::PartOfSpeech
- Defined in:
- lib/open_dictionary/part_of_speech.rb
Instance Attribute Summary collapse
-
#definition_groups ⇒ Object
readonly
Returns the value of attribute definition_groups.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
Instance Method Summary collapse
-
#initialize(data) ⇒ PartOfSpeech
constructor
A new instance of PartOfSpeech.
Constructor Details
#initialize(data) ⇒ PartOfSpeech
Returns a new instance of PartOfSpeech.
5 6 7 8 |
# File 'lib/open_dictionary/part_of_speech.rb', line 5 def initialize(data) @description = data['description'] @definition_groups = data['definitionGroups'].map { |group| DefinitionGroup.new(group) } end |
Instance Attribute Details
#definition_groups ⇒ Object (readonly)
Returns the value of attribute definition_groups.
3 4 5 |
# File 'lib/open_dictionary/part_of_speech.rb', line 3 def definition_groups @definition_groups end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
3 4 5 |
# File 'lib/open_dictionary/part_of_speech.rb', line 3 def description @description end |