Class: Top4R::Config

Inherits:
Object
  • Object
show all
Includes:
ClassUtilMixin
Defined in:
lib/top4r/config.rb

Overview

A rails like config object

Constant Summary collapse

@@ATTRIBUTES =
[
    :env,
    :host,
    :rest_uri,
    :port,
    :protocol,
    :test_host,
    :test_rest_uri,
    :test_port,
    :test_protocol,
    # :staging_host,
    #         :staging_rest_uri,
    #         :staging_port,
    #         :staging_protocol,
    :proxy_host,
    :proxy_port,
    :proxy_user,
    :proxy_pass,
    :format,
    :application_name,
    :application_key,
    :application_secret,
    :application_version,
    :application_url,
    :user_agent,
    :source,
    :logger,
    :trace
]

Instance Method Summary collapse

Methods included from ClassUtilMixin

included

Instance Method Details

#eql?(other) ⇒ Boolean

Override of Object#eql? to ensure RSpec specifications run correctly. Also done to follow Ruby best practices.

Returns:

  • (Boolean)


39
40
41
42
43
44
45
# File 'lib/top4r/config.rb', line 39

def eql?(other)
  return true if self == other
  @@ATTRIBUTES.each do |att|
    return false unless self.send(att).eql?(other.send(att))
  end
  true
end