lib/rubytter.rb in jugyo-rubytter-0.4.8 vs lib/rubytter.rb in jugyo-rubytter-0.5.0
- old
+ new
@@ -14,23 +14,22 @@
super(msg)
@response = response
end
end
- APP_NAME = 'Rubytter'
- VERSION = '0.4.8'
- HOMEPAGE = 'http://github.com/jugyo/rubytter'
+ VERSION = '0.5.0'
attr_reader :login
attr_accessor :host, :header
def initialize(login = nil, password = nil, options = {})
@login = login
@password = password
@host = options[:host] || 'twitter.com'
- @header = {'User-Agent' => "#{APP_NAME}/#{VERSION} (#{HOMEPAGE})"}
+ @header = {'User-Agent' => "Rubytter/#{VERSION} (http://github.com/jugyo/rubytter)"}
@header.merge!(options[:header]) if options[:header]
+ @app_name = options[:app_name]
@connection = Connection.new(options)
end
def self.api_settings
# method name path for API http method
@@ -84,9 +83,15 @@
def #{method}(params = {})
#{http_method}('#{path}', params)
end
EOS
end
+ end
+
+ alias_method :__update_status, :update_status
+ def update_status(params = {})
+ params[:source] = @app_name if @app_name
+ __update_status(params)
end
def update(status, params = {})
update_status(params.merge({:status => status}))
end