Class: Echo::Client
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Client
constructor
calls to echo.
- #submit(content) ⇒ Object
- #tweet_to_xml(status) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Client
calls to echo
9 10 11 12 13 |
# File 'lib/echor/client.rb', line 9 def initialize(={}) self.class.debug_output $stdout if Echo.debug self.class.base_uri "#{Echo.endpoint}/submit" self.class.basic_auth Echo.user, Echo.password end |
Instance Method Details
#submit(content) ⇒ Object
15 16 17 |
# File 'lib/echor/client.rb', line 15 def submit(content) self.class.post( "https://api.echoenabled.com/v1/submit", :query => {:content => content}) end |
#tweet_to_xml(status) ⇒ Object
19 20 21 22 |
# File 'lib/echor/client.rb', line 19 def tweet_to_xml(status) template = ERB.new(Echo.Templates.TWITTER_XML_TEMPLATE) template.result(binding) end |