Class: Porteo::Twitter_protocol
- Defined in:
- lib/protocols/twitter_protocol.rb
Overview
Implementation of Twitter protocol to be used in Porteo system. It only define specific behavior for this protocol.
Instance Attribute Summary
Attributes inherited from Protocol
Instance Method Summary collapse
-
#check_message_sections ⇒ nil
Check for the required fields to exists.
Methods inherited from Protocol
#initialize, #message, #send_message, #set_template, #set_template_params
Constructor Details
This class inherits a constructor from Porteo::Protocol
Instance Method Details
#check_message_sections ⇒ nil
Check for the required fields to exists.
33 34 35 36 37 |
# File 'lib/protocols/twitter_protocol.rb', line 33 def raise ArgumentError, "Protocol Error. There are no body section" if @message_sections[:body] == nil # the twitt must be shorter than 140 chars. raise ArgumentError, "Protocol Error. The message is too long" if @message_sections[:body].length > 140 end |