Class: Glossarist::Designation::GrammarInfo
Instance Method Summary
collapse
#slice_keys, #symbolize_keys
extended, included
extended, included
Constructor Details
#initialize(options = {}) ⇒ GrammarInfo
Returns a new instance of GrammarInfo.
17
18
19
20
21
|
# File 'lib/glossarist/designation/grammar_info.rb', line 17
def initialize(options = {})
sanitized_options(options).each do |attr, value|
public_send("#{attr}=", value)
end
end
|
Instance Method Details
#part_of_speech=(pos) ⇒ Object
23
24
25
|
# File 'lib/glossarist/designation/grammar_info.rb', line 23
def part_of_speech=(pos)
public_send("#{pos}=", pos)
end
|
#to_h ⇒ Object
27
28
29
30
31
32
33
34
35
36
37
38
|
# File 'lib/glossarist/designation/grammar_info.rb', line 27
def to_h
{
"preposition" => preposition?,
"participle" => participle?,
"adj" => adj?,
"verb" => verb?,
"adverb" => adverb?,
"noun" => noun?,
"gender" => gender,
"number" => number,
}
end
|