Class: StaticGenderizer::Result
- Inherits:
-
Object
- Object
- StaticGenderizer::Result
- Defined in:
- lib/static_genderizer/result.rb
Overview
Simple result object returned by analyze
Instance Attribute Summary collapse
-
#first_names ⇒ Object
readonly
Returns the value of attribute first_names.
-
#gender ⇒ Object
readonly
Returns the value of attribute gender.
-
#language ⇒ Object
readonly
Returns the value of attribute language.
-
#last_names ⇒ Object
readonly
Returns the value of attribute last_names.
Instance Method Summary collapse
-
#initialize(first_names:, last_names:, language:, gender:) ⇒ Result
constructor
first_names, last_names: arrays of original tokens (preserve original casing) language: symbol or nil (language that best matched) gender: :male, :female, :unknown.
- #to_h ⇒ Object
Constructor Details
#initialize(first_names:, last_names:, language:, gender:) ⇒ Result
first_names, last_names: arrays of original tokens (preserve original casing) language: symbol or nil (language that best matched) gender: :male, :female, :unknown
11 12 13 14 15 16 |
# File 'lib/static_genderizer/result.rb', line 11 def initialize(first_names:, last_names:, language:, gender:) @first_names = Array(first_names) @last_names = Array(last_names) @language = language @gender = gender end |
Instance Attribute Details
#first_names ⇒ Object (readonly)
Returns the value of attribute first_names.
6 7 8 |
# File 'lib/static_genderizer/result.rb', line 6 def first_names @first_names end |
#gender ⇒ Object (readonly)
Returns the value of attribute gender.
6 7 8 |
# File 'lib/static_genderizer/result.rb', line 6 def gender @gender end |
#language ⇒ Object (readonly)
Returns the value of attribute language.
6 7 8 |
# File 'lib/static_genderizer/result.rb', line 6 def language @language end |
#last_names ⇒ Object (readonly)
Returns the value of attribute last_names.
6 7 8 |
# File 'lib/static_genderizer/result.rb', line 6 def last_names @last_names end |
Instance Method Details
#to_h ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'lib/static_genderizer/result.rb', line 18 def to_h { first_names: first_names, last_names: last_names, language: language, gender: gender } end |