Class: Kriterion::API
- Inherits:
-
Object
- Object
- Kriterion::API
- Defined in:
- lib/kriterion/api.rb
Instance Attribute Summary collapse
-
#mongo ⇒ Object
readonly
Returns the value of attribute mongo.
-
#standards_dir ⇒ Object
readonly
Returns the value of attribute standards_dir.
Instance Method Summary collapse
-
#initialize(opts) ⇒ API
constructor
A new instance of API.
- #run ⇒ Object
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
#mongo ⇒ Object (readonly)
Returns the value of attribute mongo.
8 9 10 |
# File 'lib/kriterion/api.rb', line 8 def mongo @mongo end |
#standards_dir ⇒ Object (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
#run ⇒ Object
23 24 25 |
# File 'lib/kriterion/api.rb', line 23 def run # Find all standards and add them to mongodb end |