Class: Otc::Configuration
- Inherits:
-
Object
- Object
- Otc::Configuration
- Defined in:
- lib/otc/configuration.rb
Defined Under Namespace
Classes: MissingError
Class Attribute Summary collapse
-
.domainname ⇒ Object
Returns the value of attribute domainname.
-
.password ⇒ Object
Returns the value of attribute password.
-
.project ⇒ Object
Returns the value of attribute project.
-
.region ⇒ Object
Returns the value of attribute region.
-
.username ⇒ Object
Returns the value of attribute username.
Class Method Summary collapse
Class Attribute Details
.domainname ⇒ Object
Returns the value of attribute domainname.
6 7 8 |
# File 'lib/otc/configuration.rb', line 6 def domainname @domainname end |
.password ⇒ Object
Returns the value of attribute password.
6 7 8 |
# File 'lib/otc/configuration.rb', line 6 def password @password end |
.project ⇒ Object
Returns the value of attribute project.
6 7 8 |
# File 'lib/otc/configuration.rb', line 6 def project @project end |
.region ⇒ Object
Returns the value of attribute region.
6 7 8 |
# File 'lib/otc/configuration.rb', line 6 def region @region end |
.username ⇒ Object
Returns the value of attribute username.
6 7 8 |
# File 'lib/otc/configuration.rb', line 6 def username @username end |
Class Method Details
.configure {|_self| ... } ⇒ Object
8 9 10 |
# File 'lib/otc/configuration.rb', line 8 def configure yield self end |
.method_missing(m, *args, &block) ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/otc/configuration.rb', line 20 def method_missing(m, *args, &block) m_as_string = m.to_s if m_as_string.end_with?("!") method = m_as_string.split("!").first.to_sym if self.respond_to?(method) send(method).tap do |result| raise MissingError, "missing configuration #{method}" if result.nil? end else super end else super end end |
.reset ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/otc/configuration.rb', line 12 def reset @project = nil @username = nil @password = nil @region = nil @domainname = nil end |