Class: Couchbase::ConfigProfiles::Profiles
- Inherits:
-
Object
- Object
- Couchbase::ConfigProfiles::Profiles
- Defined in:
- lib/couchbase/config_profiles.rb,
/code/couchbase-ruby-client/lib/couchbase/config_profiles.rb
Instance Attribute Summary collapse
-
#profiles ⇒ Object
readonly
Returns the value of attribute profiles.
Instance Method Summary collapse
- #apply(profile_name, options) ⇒ Object
-
#initialize ⇒ Profiles
constructor
A new instance of Profiles.
- #register_profile(name, profile) ⇒ Object
Constructor Details
#initialize ⇒ Profiles
Returns a new instance of Profiles.
22 23 24 25 |
# File 'lib/couchbase/config_profiles.rb', line 22 def initialize @profiles = {} register_profile("wan_development", DevelopmentProfile.new) end |
Instance Attribute Details
#profiles ⇒ Object (readonly)
Returns the value of attribute profiles.
20 21 22 |
# File 'lib/couchbase/config_profiles.rb', line 20 def profiles @profiles end |
Instance Method Details
#apply(profile_name, options) ⇒ Object
31 32 33 34 35 |
# File 'lib/couchbase/config_profiles.rb', line 31 def apply(profile_name, ) raise ArgumentError, "#{profile_name} is not a registered profile" unless @profiles.key?(profile_name) @profiles[profile_name].apply() end |
#register_profile(name, profile) ⇒ Object
27 28 29 |
# File 'lib/couchbase/config_profiles.rb', line 27 def register_profile(name, profile) @profiles[name] = profile end |