Class: Warb::Components::Name
- Inherits:
-
Object
- Object
- Warb::Components::Name
- Defined in:
- lib/warb/components/name.rb
Instance Attribute Summary collapse
-
#first_name ⇒ Object
Returns the value of attribute first_name.
-
#formatted_name ⇒ Object
Returns the value of attribute formatted_name.
-
#last_name ⇒ Object
Returns the value of attribute last_name.
-
#middle_name ⇒ Object
Returns the value of attribute middle_name.
-
#prefix ⇒ Object
Returns the value of attribute prefix.
-
#suffix ⇒ Object
Returns the value of attribute suffix.
Instance Method Summary collapse
-
#initialize(**params) ⇒ Name
constructor
A new instance of Name.
- #to_h ⇒ Object
Constructor Details
#initialize(**params) ⇒ Name
Returns a new instance of Name.
8 9 10 11 12 13 14 15 |
# File 'lib/warb/components/name.rb', line 8 def initialize(**params) @formatted_name = params[:formatted_name] @first_name = params[:first_name] @last_name = params[:last_name] @middle_name = params[:middle_name] @suffix = params[:suffix] @prefix = params[:prefix] end |
Instance Attribute Details
#first_name ⇒ Object
Returns the value of attribute first_name.
6 7 8 |
# File 'lib/warb/components/name.rb', line 6 def first_name @first_name end |
#formatted_name ⇒ Object
Returns the value of attribute formatted_name.
6 7 8 |
# File 'lib/warb/components/name.rb', line 6 def formatted_name @formatted_name end |
#last_name ⇒ Object
Returns the value of attribute last_name.
6 7 8 |
# File 'lib/warb/components/name.rb', line 6 def last_name @last_name end |
#middle_name ⇒ Object
Returns the value of attribute middle_name.
6 7 8 |
# File 'lib/warb/components/name.rb', line 6 def middle_name @middle_name end |
#prefix ⇒ Object
Returns the value of attribute prefix.
6 7 8 |
# File 'lib/warb/components/name.rb', line 6 def prefix @prefix end |
#suffix ⇒ Object
Returns the value of attribute suffix.
6 7 8 |
# File 'lib/warb/components/name.rb', line 6 def suffix @suffix end |
Instance Method Details
#to_h ⇒ Object
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/warb/components/name.rb', line 17 def to_h { formatted_name: formatted_name, first_name: first_name, last_name: last_name, middle_name: middle_name, suffix: suffix, prefix: prefix } end |