Class: Mascot::DAT::SearchDatabases

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/mascot/dat/search_databases.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = nil) ⇒ SearchDatabases

Returns a new instance of SearchDatabases.



6
7
8
9
10
11
# File 'lib/mascot/dat/search_databases.rb', line 6

def initialize(params=nil)
  @dbs = []
  if params
    parse(params)
  end
end

Class Method Details

.parse(params) ⇒ Object



13
14
15
# File 'lib/mascot/dat/search_databases.rb', line 13

def self.parse(params)
  tmp = SearchDatabases.new(params)
end

Instance Method Details

#[](idx) ⇒ Object



17
18
19
# File 'lib/mascot/dat/search_databases.rb', line 17

def []idx
  @dbs[idx]
end

#eachObject



28
29
30
31
32
# File 'lib/mascot/dat/search_databases.rb', line 28

def each
  @dbs.each do |db|
    yield db
  end
end

#parse(params) ⇒ Object



21
22
23
24
25
26
# File 'lib/mascot/dat/search_databases.rb', line 21

def parse(params)
  dbkeys = params.names.grep(/db/i).sort
  dbkeys.each do |k|
    @dbs <<  params[k]
  end
end