Sha256: a8378b35ba197d40d3f4588e275628671f87ce3cdc7afe69b7b32c34327ad0f1

Contents?: true

Size: 983 Bytes

Versions: 9

Compression:

Stored size: 983 Bytes

Contents

class Twitter::Client
  @@PROFILE_URIS = {
    :info => '/account/update_profile',
    :colors => '/account/update_profile_colors',
    :device => '/account/update_delivery_device',
  }
  
  # Provides access to the Twitter Profile API.
  # 
  # You can update profile information.  You can update the types of profile 
  # information:
  # * :info (name, email, url, location, description)
  # * :colors (background_color, text_color, link_color, sidebar_fill_color, 
  # sidebar_border_color)
  # * :device (set device to either "sms", "im" or "none")
  # 
  # Example:
  #  user = client.profile(:info, :location => "University Library")
  #  puts user.inspect
  def profile(action, attributes)
    connection = create_http_connection
    connection.start do |connection|
      response = http_connect(attributes.to_http_str) do |conn|
        create_http_post_request(@@PROFILE_URIS[action])
      end
      bless_models(Twitter::User.unmarshal(response.body))
    end
  end
end

Version data entries

9 entries across 9 versions & 8 rubygems

Version Path
NewMonarch-twitter4r-0.3.2 lib/twitter/client/profile.rb
craigtmackenzie-twitter4r-0.3.1 lib/twitter/client/profile.rb
dambalah-twitter4r-0.3.3 lib/twitter/client/profile.rb
dferranti-twitter4r-0.4.0.1 lib/twitter/client/profile.rb
filipegiusti-twitter4r-0.3.2.1 lib/twitter/client/profile.rb
mbbx6spp-twitter4r-0.4.0 lib/twitter/client/profile.rb
theill-twitter4r-0.3.2 lib/twitter/client/profile.rb
twitter4r-0.3.2 lib/twitter/client/profile.rb
twitter4r-0.3.1 lib/twitter/client/profile.rb