Class: Gendered::NameList
- Inherits:
-
Object
- Object
- Gendered::NameList
- Includes:
- Enumerable
- Defined in:
- lib/gendered/name_list.rb
Instance Attribute Summary collapse
-
#names ⇒ Object
readonly
Returns the value of attribute names.
Instance Method Summary collapse
- #[](value) ⇒ Object
- #each(&block) ⇒ Object
- #guess!(country_id = nil) ⇒ Object
-
#initialize(values) ⇒ NameList
constructor
A new instance of NameList.
Constructor Details
Instance Attribute Details
#names ⇒ Object (readonly)
Returns the value of attribute names.
5 6 7 |
# File 'lib/gendered/name_list.rb', line 5 def names @names end |
Instance Method Details
#[](value) ⇒ Object
29 30 31 32 33 |
# File 'lib/gendered/name_list.rb', line 29 def [](value) names.find do |name| name.value == value end end |
#each(&block) ⇒ Object
23 24 25 26 27 |
# File 'lib/gendered/name_list.rb', line 23 def each(&block) names.each do |name| block.call name end end |