Class: Mongodump::DB::Base
- Inherits:
-
Object
- Object
- Mongodump::DB::Base
- Defined in:
- lib/mongodump/db/base.rb
Instance Attribute Summary collapse
-
#appname ⇒ Object
Returns the value of attribute appname.
-
#hostname ⇒ Object
Returns the value of attribute hostname.
-
#password ⇒ Object
Returns the value of attribute password.
-
#port ⇒ Object
Returns the value of attribute port.
-
#protocol ⇒ Object
Returns the value of attribute protocol.
-
#uri ⇒ Object
Returns the value of attribute uri.
-
#username ⇒ Object
Returns the value of attribute username.
Instance Method Summary collapse
- #has_all_attributes? ⇒ Boolean
-
#initialize(arg) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(arg) ⇒ Base
Returns a new instance of Base.
12 13 14 15 16 17 18 19 |
# File 'lib/mongodump/db/base.rb', line 12 def initialize(arg) if arg.is_a?(String) @uri = arg parse else raise IncompatibleArgumentException end end |
Instance Attribute Details
#appname ⇒ Object
Returns the value of attribute appname.
10 11 12 |
# File 'lib/mongodump/db/base.rb', line 10 def appname @appname end |
#hostname ⇒ Object
Returns the value of attribute hostname.
8 9 10 |
# File 'lib/mongodump/db/base.rb', line 8 def hostname @hostname end |
#password ⇒ Object
Returns the value of attribute password.
7 8 9 |
# File 'lib/mongodump/db/base.rb', line 7 def password @password end |
#port ⇒ Object
Returns the value of attribute port.
9 10 11 |
# File 'lib/mongodump/db/base.rb', line 9 def port @port end |
#protocol ⇒ Object
Returns the value of attribute protocol.
5 6 7 |
# File 'lib/mongodump/db/base.rb', line 5 def protocol @protocol end |
#uri ⇒ Object
Returns the value of attribute uri.
4 5 6 |
# File 'lib/mongodump/db/base.rb', line 4 def uri @uri end |
#username ⇒ Object
Returns the value of attribute username.
6 7 8 |
# File 'lib/mongodump/db/base.rb', line 6 def username @username end |
Instance Method Details
#has_all_attributes? ⇒ Boolean
21 22 23 24 25 26 27 |
# File 'lib/mongodump/db/base.rb', line 21 def has_all_attributes? for variable in [@uri, @protocol, @username, @password, @hostname, @port, @appname] if variable.blank? return false end end end |