Class: WePredict::Classifiers::Classifier
- Defined in:
- lib/wepredict/classifier.rb
Direct Known Subclasses
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ Classifier
constructor
A new instance of Classifier.
Methods inherited from API
Constructor Details
#initialize ⇒ Classifier
Returns a new instance of Classifier.
5 6 7 |
# File 'lib/wepredict/classifier.rb', line 5 def initialize @api_key = Classifier.api_key end |
Class Method Details
.api_key ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/wepredict/classifier.rb', line 14 def self.api_key f = File.open(File.("~/.wepredict"), 'r') k = f.read(32) f.close k end |
.classify(options) ⇒ Object
9 10 11 12 |
# File 'lib/wepredict/classifier.rb', line 9 def self.classify() params? , [:text] make_request("classifiers/#{self.class_name}/classify", .merge(:api_key => self.api_key)) end |