Class: Snatch::Session
- Inherits:
-
Object
- Object
- Snatch::Session
- Defined in:
- lib/snatch/session.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#filename ⇒ Object
readonly
Returns the value of attribute filename.
Instance Method Summary collapse
-
#initialize(config) ⇒ Session
constructor
A new instance of Session.
- #run! ⇒ Object
Constructor Details
#initialize(config) ⇒ Session
Returns a new instance of Session.
9 10 11 12 13 14 |
# File 'lib/snatch/session.rb', line 9 def initialize(config) @config = config @config[:port] = config[:port] || 22 @ssh = nil @filename = "#{@config[:host]}_#{Time.now.strftime("%Y%m%d%H%M%S")}.sql.gz" end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
7 8 9 |
# File 'lib/snatch/session.rb', line 7 def config @config end |
#filename ⇒ Object (readonly)
Returns the value of attribute filename.
7 8 9 |
# File 'lib/snatch/session.rb', line 7 def filename @filename end |
Instance Method Details
#run! ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'lib/snatch/session.rb', line 16 def run! connect test dump download cleanup disconnect end |