Sha256: a409991fd937d24719c1538b0a1a6ddb694240b498c81e5c53dfb040ab9c9a61

Contents?: true

Size: 1.29 KB

Versions: 24

Compression:

Stored size: 1.29 KB

Contents

# encoding: utf-8

module Github
  class Users
    module Emails

      # List email addresses for the authenticated user
      #
      # = Examples
      #  @github = Github.new :oauth_token => '...'
      #  @github.users.emails
      #
      def emails(params={})
        get("/user/emails", params)
      end

      # Add email address(es) for the authenticated user
      #
      # = Inputs
      # You can include a single email address or an array of addresses
      #
      # = Examples
      #  @github = Github.new :oauth_token => '...'
      #  @github.users.add_email "octocat@github.com", "support@github.com"
      #
      def add_email(*args)
        params = _extract_parameters(args)
        params['data'] = [args].flatten
        post("/user/emails", params)
      end

      # Delete email address(es) for the authenticated user
      #
      # = Inputs
      # You can include a single email address or an array of addresses
      #
      # = Examples
      #  @github = Github.new :oauth_token => '...'
      #  @github.users.delete_email "octocat@github.com", "support@github.com"
      #
      def add_email(*args)
        params = _extract_parameters(args)
        params['data'] = [args].flatten
        delete("/user/emails", params)
      end

    end # Emails
  end # Users
end # Github

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
github_api-0.4.7 lib/github_api/users/emails.rb
github_api-0.4.6 lib/github_api/users/emails.rb
github_api-0.4.5 lib/github_api/users/emails.rb
github_api-0.4.4 lib/github_api/users/emails.rb
github_api-0.4.3 lib/github_api/users/emails.rb
github_api-0.4.2 lib/github_api/users/emails.rb
github_api-0.4.1 lib/github_api/users/emails.rb
github_api-0.4.0 lib/github_api/users/emails.rb
github_api-0.3.9 lib/github_api/users/emails.rb
github_api-0.3.8 lib/github_api/users/emails.rb
github_api-0.3.7 lib/github_api/users/emails.rb
github_api-0.3.6 lib/github_api/users/emails.rb
github_api-0.3.4 lib/github_api/users/emails.rb
github_api-0.3.3 lib/github_api/users/emails.rb
github_api-0.3.2 lib/github_api/users/emails.rb
github_api-0.3.1 lib/github_api/users/emails.rb
github_api-0.3.0 lib/github_api/users/emails.rb
github_api-0.2.2 lib/github_api/users/emails.rb
github_api-0.2.1 lib/github_api/users/emails.rb
github_api-0.2.0 lib/github_api/users/emails.rb