Class: Wedding::Groom

Inherits:
Object
  • Object
show all
Defined in:
lib/wedding/groom.rb

Overview

No wedding without a groom

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Groom

Get him ready for all pomp and show



5
6
7
8
9
10
# File 'lib/wedding/groom.rb', line 5

def initialize(config)
  self.name = config[:groom_name]
  self.about = config[:groom_about]
  self.occupation = config[:groom_occupation]
  self.email = config[:groom_email]
end

Instance Attribute Details

#aboutObject

Returns the value of attribute about.



25
26
27
# File 'lib/wedding/groom.rb', line 25

def about
  @about
end

#emailObject

Returns the value of attribute email.



25
26
27
# File 'lib/wedding/groom.rb', line 25

def email
  @email
end

#nameObject

Returns the value of attribute name.



25
26
27
# File 'lib/wedding/groom.rb', line 25

def name
  @name
end

#occupationObject

Returns the value of attribute occupation.



25
26
27
# File 'lib/wedding/groom.rb', line 25

def occupation
  @occupation
end

Instance Method Details

#to_sObject

Overriding for pretty printing



13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/wedding/groom.rb', line 13

def to_s
  groom_gungaan = %Q[
========= Groom ==========

The groom's name is #{self.name}
He is a #{self.about}
He works as a #{self.occupation}
If you want to contact him, his email ID
is #{self.email}

  ]
end