Class: Application::Configuration::Location

Inherits:
Object
  • Object
show all
Defined in:
lib/application_configuration.rb

Constant Summary collapse

FILE =
:file
URL =
:url
HASH =
:hash

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(loc, type = Application::Configuration::Location::FILE) ⇒ Location

Returns a new instance of Location.



203
204
205
206
# File 'lib/application_configuration.rb', line 203

def initialize(loc, type = Application::Configuration::Location::FILE)
  self.type = type
  self.name = loc
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



200
201
202
# File 'lib/application_configuration.rb', line 200

def name
  @name
end

#optionsObject

Returns the value of attribute options.



201
202
203
# File 'lib/application_configuration.rb', line 201

def options
  @options
end

#typeObject

Returns the value of attribute type.



199
200
201
# File 'lib/application_configuration.rb', line 199

def type
  @type
end

Class Method Details

.supported_typesObject



208
209
210
# File 'lib/application_configuration.rb', line 208

def self.supported_types
  [Application::Configuration::Location::FILE, Application::Configuration::Location::URL, Application::Configuration::Location::HASH]
end

Instance Method Details

#==(other) ⇒ Object



216
217
218
# File 'lib/application_configuration.rb', line 216

def ==(other)
  self.name.to_s == other.name.to_s
end

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


220
221
222
# File 'lib/application_configuration.rb', line 220

def eql?(other)
  self.name.to_s == other.name.to_s
end

#hashObject



224
225
226
# File 'lib/application_configuration.rb', line 224

def hash
  self.name.to_s.hash
end