Class: OpenDictionary::PartOfSpeech

Inherits:
Object
  • Object
show all
Defined in:
lib/open_dictionary/part_of_speech.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_groupsObject (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

#descriptionObject (readonly)

Returns the value of attribute description.



3
4
5
# File 'lib/open_dictionary/part_of_speech.rb', line 3

def description
  @description
end