Class: DatabasePatcher::Fetcher
- Inherits:
-
Object
- Object
- DatabasePatcher::Fetcher
- Defined in:
- lib/database_patcher/fetcher.rb
Instance Method Summary collapse
- #get_intalled_patches ⇒ Object
- #get_pending_patches ⇒ Object
-
#initialize(connection) ⇒ Fetcher
constructor
A new instance of Fetcher.
Constructor Details
#initialize(connection) ⇒ Fetcher
Returns a new instance of Fetcher.
3 4 5 |
# File 'lib/database_patcher/fetcher.rb', line 3 def initialize(connection) @connection = connection end |
Instance Method Details
#get_intalled_patches ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/database_patcher/fetcher.rb', line 7 def get_intalled_patches patches = get_patches.reverse installed_patches = [] = patches.each do |patch| break unless .include?(patch.) installed_patches.push(patch) end installed_patches end |
#get_pending_patches ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/database_patcher/fetcher.rb', line 20 def get_pending_patches patches = get_patches pending_patches = [] = patches.each do |patch| break if .include?(patch.) pending_patches.push(patch) end pending_patches end |