Class: LongTweet::Master
- Inherits:
-
Object
- Object
- LongTweet::Master
- Defined in:
- lib/long_tweet.rb
Instance Attribute Summary collapse
-
#agent ⇒ Object
readonly
Returns the value of attribute agent.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
-
#tweets ⇒ Object
readonly
Returns the value of attribute tweets.
Instance Method Summary collapse
- #configure_agent ⇒ Object
- #create_ordered_tweets ⇒ Object
-
#initialize(text, agent) ⇒ Master
constructor
A new instance of Master.
- #post ⇒ Object
Constructor Details
#initialize(text, agent) ⇒ Master
Returns a new instance of Master.
16 17 18 19 20 21 |
# File 'lib/long_tweet.rb', line 16 def initialize text, agent @text = text @agent = agent create_ordered_tweets configure_agent end |
Instance Attribute Details
#agent ⇒ Object (readonly)
Returns the value of attribute agent.
15 16 17 |
# File 'lib/long_tweet.rb', line 15 def agent @agent end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
15 16 17 |
# File 'lib/long_tweet.rb', line 15 def text @text end |
#tweets ⇒ Object (readonly)
Returns the value of attribute tweets.
15 16 17 |
# File 'lib/long_tweet.rb', line 15 def tweets @tweets end |
Instance Method Details
#configure_agent ⇒ Object
23 24 25 |
# File 'lib/long_tweet.rb', line 23 def configure_agent Config.new(agent).configure end |
#create_ordered_tweets ⇒ Object
27 28 29 30 |
# File 'lib/long_tweet.rb', line 27 def create_ordered_tweets tweets = Splitter.new(text).split @tweets = Arranger.new(tweets).order end |
#post ⇒ Object
32 33 34 35 |
# File 'lib/long_tweet.rb', line 32 def post tweets.each(&:post) puts "Sending Tweet: #{text}" end |