Class: ConfBuilder::Talk

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params) ⇒ Talk

Returns a new instance of Talk.



12
13
14
15
16
# File 'lib/talk.rb', line 12

def initialize(params)
  @title = params[:title]
  @speaker = ['Uncle Bob Martin','Corey Haines','DHH'].sample
  self
end

Instance Attribute Details

#durationObject

Returns the value of attribute duration.



8
9
10
# File 'lib/talk.rb', line 8

def duration
  @duration
end

#duration_unitObject

Returns the value of attribute duration_unit.



9
10
11
# File 'lib/talk.rb', line 9

def duration_unit
  @duration_unit
end

#speakerObject (readonly)

Returns the value of attribute speaker.



10
11
12
# File 'lib/talk.rb', line 10

def speaker
  @speaker
end

#titleObject (readonly)

Returns the value of attribute title.



7
8
9
# File 'lib/talk.rb', line 7

def title
  @title
end

Instance Method Details

#to_sObject



18
19
20
# File 'lib/talk.rb', line 18

def to_s
  "#{@title} #{@duration}#{duration_unit.slice(0, 3)}" 
end