Class: Couchbase::ConfigProfiles::Profiles

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeProfiles

Returns a new instance of Profiles.



20
21
22
23
# File 'lib/couchbase/config_profiles.rb', line 20

def initialize
  @profiles = {}
  register_profile("wan_development", DevelopmentProfile.new)
end

Instance Attribute Details

#profilesObject (readonly)

Returns the value of attribute profiles.



18
19
20
# File 'lib/couchbase/config_profiles.rb', line 18

def profiles
  @profiles
end

Instance Method Details

#apply(profile_name, options) ⇒ Object

Raises:

  • (ArgumentError)


29
30
31
32
33
# File 'lib/couchbase/config_profiles.rb', line 29

def apply(profile_name, options)
  raise ArgumentError, "#{profile_name} is not a registered profile" unless @profiles.key?(profile_name)

  @profiles[profile_name].apply(options)
end

#register_profile(name, profile) ⇒ Object



25
26
27
# File 'lib/couchbase/config_profiles.rb', line 25

def register_profile(name, profile)
  @profiles[name] = profile
end