Class: OpenDictionary::Etymology

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Etymology

Returns a new instance of Etymology.



6
7
8
9
10
11
12
13
14
15
# File 'lib/open_dictionary/etymology.rb', line 6

def initialize(data)
  @description = data['description']
  @nouns = parse_parts_of_speech(data['nouns'])
  @verbs = parse_parts_of_speech(data['verbs'])
  @adjectives = parse_parts_of_speech(data['adjectives'])
  @prepositions = parse_parts_of_speech(data['prepositions'])
  @adverbs = parse_parts_of_speech(data['adverbs'])
  @letter = parse_parts_of_speech(data['letter'])
  @number = parse_parts_of_speech(data['number'])
end

Instance Attribute Details

#adjectivesObject (readonly)

Returns the value of attribute adjectives.



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

def adjectives
  @adjectives
end

#adverbsObject (readonly)

Returns the value of attribute adverbs.



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

def adverbs
  @adverbs
end

#descriptionObject (readonly)

Returns the value of attribute description.



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

def description
  @description
end

#letterObject (readonly)

Returns the value of attribute letter.



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

def letter
  @letter
end

#nounsObject (readonly)

Returns the value of attribute nouns.



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

def nouns
  @nouns
end

#numberObject (readonly)

Returns the value of attribute number.



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

def number
  @number
end

#prepositionsObject (readonly)

Returns the value of attribute prepositions.



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

def prepositions
  @prepositions
end

#verbsObject (readonly)

Returns the value of attribute verbs.



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

def verbs
  @verbs
end