Class: TweetingCake::CakeSlicer

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(twitter_client) ⇒ CakeSlicer

Returns a new instance of CakeSlicer.



5
6
7
# File 'lib/tweeting_cake/cake_slicer.rb', line 5

def initialize(twitter_client)
  @twitter_client = twitter_client
end

Instance Attribute Details

#twitter_clientObject (readonly)

Returns the value of attribute twitter_client.



3
4
5
# File 'lib/tweeting_cake/cake_slicer.rb', line 3

def twitter_client
  @twitter_client
end

Instance Method Details

#serve_a_slice_from(cake) ⇒ Object



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

def serve_a_slice_from(cake)
  twitter_client.tweet(cake.tweetable_description)
end