Class: Unit::Types::FullName

Inherits:
Object
  • Object
show all
Defined in:
lib/unit/types/full_name.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(first, last) ⇒ FullName

Returns a new instance of FullName.

Parameters:

  • first (String)

    The first name

  • last (String)

    The last name



10
11
12
13
# File 'lib/unit/types/full_name.rb', line 10

def initialize(first, last)
  @first = first
  @last = last
end

Instance Attribute Details

#firstObject (readonly)

Returns the value of attribute first.



6
7
8
# File 'lib/unit/types/full_name.rb', line 6

def first
  @first
end

#lastObject (readonly)

Returns the value of attribute last.



6
7
8
# File 'lib/unit/types/full_name.rb', line 6

def last
  @last
end

Instance Method Details

#representObject



15
16
17
18
19
20
# File 'lib/unit/types/full_name.rb', line 15

def represent
  {
    first: first,
    last: last
  }
end