### Home Classes Methods

### In Files

- lib/github_api/core_ext/ordered_hash.rb

### Parent

Hash

### Methods

- ::[]
- ::new
- #==
- #[]=
- #__class__
- #class
- #clear
- #delete
- #delete_if
- #each
- #each_key
- #each_pair
- #each_value
- #keys
- #replace
- #shift
- #values

### Class/Module Index

Quicksearch

- Github
- Github::API
- Github::Activity
- Github::Activity::Events
- Github::Activity::Notifications
- Github::Activity::Starring
- Github::Activity::Watching
- Github::ApiFactory
- Github::Arguments
- Github::Authorization
- Github::Authorizations
- Github::AutoloadHelper
- Github::Client
- Github::Configuration
- Github::Connection
- Github::Constants
- Github::CoreExt
- Github::CoreExt::OrderedHash
- Github::Descendants
- Github::Emojis
- Github::Error
- Github::Error::BadRequest
- Github::Error::ClientError
- Github::Error::Forbidden
- Github::Error::GithubError
- Github::Error::InternalServerError
- Github::Error::InvalidOptions
- Github::Error::NotAcceptable
- Github::Error::NotFound
- Github::Error::RequiredParams
- Github::Error::ServiceError
- Github::Error::ServiceUnavailable
- Github::Error::Unauthorized
- Github::Error::UnknownValue
- Github::Error::UnprocessableEntity
- Github::Error::Validations
- Github::Gists
- Github::Gists::Comments
- Github::GitData
- Github::GitData::Blobs
- Github::GitData::Commits
- Github::GitData::References
- Github::GitData::Tags
- Github::GitData::Trees
- Github::Gitignore
- Github::Issues
- Github::Issues::Assignees
- Github::Issues::Comments
- Github::Issues::Events
- Github::Issues::Labels
- Github::Issues::Milestones
- Github::Jsonable
- Github::Markdown
- Github::Meta
- Github::MimeType
- Github::Normalizer
- Github::Orgs
- Github::Orgs::Members
- Github::Orgs::Teams
- Github::PageIterator
- Github::PageLinks
- Github::PagedRequest
- Github::Pagination
- Github::ParameterFilter
- Github::ParamsHash
- Github::PullRequests
- Github::PullRequests::Comments
- Github::RateLimit
- Github::Repos
- Github::Repos::Collaborators
- Github::Repos::Comments
- Github::Repos::Commits
- Github::Repos::Contents
- Github::Repos::Downloads
- Github::Repos::Forks
- Github::Repos::Hooks
- Github::Repos::Keys
- Github::Repos::Merging
- Github::Repos::PubSubHubbub
- Github::Repos::Statistics
- Github::Repos::Statuses
- Github::Request
- Github::Request::BasicAuth
- Github::Request::Jsonize
- Github::Request::OAuth2
- Github::Resource
- Github::Response
- Github::Response::Header
- Github::Response::Jsonize
- Github::Response::Mashify
- Github::Response::RaiseError
- Github::Response::Xmlize
- Github::ResponseWrapper
- Github::S3Uploader
- Github::Say
- Github::Scopes
- Github::Search
- Github::Users
- Github::Users::Emails
- Github::Users::Followers
- Github::Users::Keys
- Github::Utils
- Github::Utils::Url
- Github::VERSION
- Github::Validations
- Github::Validations::Format
- Github::Validations::Presence
- Github::Validations::Required
- Github::Validations::Token
- Hash

No matching classes.

# Github::CoreExt::OrderedHash

### Attributes

order[RW]

### Public Class Methods

[](*args) click to toggle source

    # File lib/github_api/core_ext/ordered_hash.rb, line 12
    def [](*args)
      hsh = OrderedHash.new
      if Hash == args[0]
        hsh.replace args[0]
      elsif (args.size % 2) != 0
        pp args
        raise ArgumentError, "odd number of elements for Hash"
      else
        0.step(args.size - 1, 2) do |a|
          b = a + 1
          hsh[args[a]] = args[b]
        end
      end
      hsh
    end

new(*args, &block) click to toggle source

    # File lib/github_api/core_ext/ordered_hash.rb, line 29
    def initialize(*args, &block)
      super
      @order = []
    end

### Public Instance Methods

==(hsh2) click to toggle source

    # File lib/github_api/core_ext/ordered_hash.rb, line 39
    def ==(hsh2)
      return false if @order != hsh2.order
      super hsh2
    end

[]=(key, value) click to toggle source

    # File lib/github_api/core_ext/ordered_hash.rb, line 34
    def []=(key, value)
      @order.push key unless member?(key)
      super key, value
    end

__class__() click to toggle source

    # File lib/github_api/core_ext/ordered_hash.rb, line 99
    def __class__
      OrderedHash
    end

class() click to toggle source

    # File lib/github_api/core_ext/ordered_hash.rb, line 95
    def class
      Hash
    end

clear() click to toggle source

    # File lib/github_api/core_ext/ordered_hash.rb, line 44
    def clear
      @order = []
      super
    end

delete(key) click to toggle source

    # File lib/github_api/core_ext/ordered_hash.rb, line 49
    def delete(key)
      @order.delete key
      super
    end

delete_if() click to toggle source

    # File lib/github_api/core_ext/ordered_hash.rb, line 70
    def delete_if
      @order.clone.each { |k| delete k if yield }
      self
    end

each() click to toggle source

    # File lib/github_api/core_ext/ordered_hash.rb, line 64
    def each
      @order.each { |k| yield k, self[k] }
      self
    end

Also aliased as: each_pair
each_key() click to toggle source

    # File lib/github_api/core_ext/ordered_hash.rb, line 54
    def each_key
      @order.each { |k| yield k }
      self
    end

each_pair() click to toggle source
Alias for: each
each_value() click to toggle source

    # File lib/github_api/core_ext/ordered_hash.rb, line 59
    def each_value
      @order.each { |k| yield self[k] }
      self
    end

keys() click to toggle source

    # File lib/github_api/core_ext/ordered_hash.rb, line 81
    def keys
      @order
    end

replace(hsh2) click to toggle source

    # File lib/github_api/core_ext/ordered_hash.rb, line 85
    def replace(hsh2)
      @order = hsh2.keys
      super hsh2
    end

shift() click to toggle source

    # File lib/github_api/core_ext/ordered_hash.rb, line 90
    def shift
      key = @order.first
      key ? [key, delete(key)] : super
    end

values() click to toggle source

    # File lib/github_api/core_ext/ordered_hash.rb, line 75
    def values
      ary = []
      @order.each { |k| ary.push self[k] }
      ary
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.