Navigation Menu

Skip to content

Commit

Permalink
Define class methods to generate catalog easily
Browse files Browse the repository at this point in the history
  • Loading branch information
piroor committed Jun 27, 2014
1 parent d80185a commit 9982879
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions lib/droonga/catalog_generator.rb
Expand Up @@ -24,6 +24,24 @@ class CatalogGenerator
DEFAULT_PORT = 10031
DEFAULT_TAG = "droonga"

class << self
def new(datasets_params=nil)
generator = super

if datasets_params
datasets_params.each do |name, params|
generator.add_dataset(name, params)
end
end

generator
end

def generate(datasets_params)
new(datasets_params).generate
end
end

def initialize
@version = 2
@effective_date = Time.now
Expand Down

0 comments on commit 9982879

Please sign in to comment.