Class: Kriterion::API

Inherits:
Object
  • Object
show all
Defined in:
lib/kriterion/api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opts) ⇒ API

Returns a new instance of API.



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/kriterion/api.rb', line 11

def initialize(opts)
  if opts[:debug]
    logger.level = Kriterion::Logs::DEBUG
  end

  @mongo_hostname = opts[:mongo_hostname]
  @mongo_port     = opts[:mongo_port]
  @mongo_database = opts[:mongo_database]
  @mongo          = Mongo::Client.new([ "#{@mongo_hostname}:#{@mongo_port}" ], :database => @mongo_database)
  @standards_dir  = opts[:standards_dir]
end

Instance Attribute Details

#mongoObject (readonly)

Returns the value of attribute mongo.



8
9
10
# File 'lib/kriterion/api.rb', line 8

def mongo
  @mongo
end

#standards_dirObject (readonly)

Returns the value of attribute standards_dir.



9
10
11
# File 'lib/kriterion/api.rb', line 9

def standards_dir
  @standards_dir
end

Instance Method Details

#runObject



23
24
25
# File 'lib/kriterion/api.rb', line 23

def run
  # Find all standards and add them to mongodb
end