Class: Fucko::Name
- Inherits:
-
Object
- Object
- Fucko::Name
- Defined in:
- lib/fucko/name.rb
Constant Summary collapse
- ENDINGS =
["%sson", "von %s", "%sevich", "%sman", "%sowsky", "%s", "%sov", "%sworth", "Mc%s"]
Instance Attribute Summary collapse
-
#first_name ⇒ Object
readonly
Returns the value of attribute first_name.
-
#last_name ⇒ Object
readonly
Returns the value of attribute last_name.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(first_name, last_name) ⇒ Name
constructor
A new instance of Name.
- #to_s ⇒ Object
Constructor Details
#initialize(first_name, last_name) ⇒ Name
Returns a new instance of Name.
22 23 24 25 |
# File 'lib/fucko/name.rb', line 22 def initialize(first_name, last_name) @first_name = first_name @last_name = last_name end |
Instance Attribute Details
#first_name ⇒ Object (readonly)
Returns the value of attribute first_name.
5 6 7 |
# File 'lib/fucko/name.rb', line 5 def first_name @first_name end |
#last_name ⇒ Object (readonly)
Returns the value of attribute last_name.
5 6 7 |
# File 'lib/fucko/name.rb', line 5 def last_name @last_name end |
Class Method Details
.first_name ⇒ Object
9 10 11 |
# File 'lib/fucko/name.rb', line 9 def self.first_name name.first_name end |
.last_name ⇒ Object
13 14 15 |
# File 'lib/fucko/name.rb', line 13 def self.last_name name.last_name end |
.name ⇒ Object
17 18 19 20 |
# File 'lib/fucko/name.rb', line 17 def self.name self.new(Dictionary.noun.capitalize, ENDINGS.sample % Dictionary.noun.capitalize) end |
Instance Method Details
#to_s ⇒ Object
27 28 29 |
# File 'lib/fucko/name.rb', line 27 def to_s "#{first_name} #{last_name}" end |