Class: Warb::Components::Name

Inherits:
Object
  • Object
show all
Defined in:
lib/warb/components/name.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_nameObject

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_nameObject

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_nameObject

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_nameObject

Returns the value of attribute middle_name.



6
7
8
# File 'lib/warb/components/name.rb', line 6

def middle_name
  @middle_name
end

#prefixObject

Returns the value of attribute prefix.



6
7
8
# File 'lib/warb/components/name.rb', line 6

def prefix
  @prefix
end

#suffixObject

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_hObject



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