Class: Hatefreeweb::Client
- Inherits:
-
Object
- Object
- Hatefreeweb::Client
- Includes:
- HTTParty
- Defined in:
- lib/hatefreeweb/client.rb
Instance Attribute Summary collapse
-
#api_key ⇒ Object
readonly
Returns the value of attribute api_key.
Instance Method Summary collapse
- #detect(body, lang) ⇒ Object
-
#initialize(api_key = nil) ⇒ Client
constructor
Get a free api_key @ www.hatefreeweb.org.
Constructor Details
#initialize(api_key = nil) ⇒ Client
Get a free api_key @ www.hatefreeweb.org
12 13 14 15 16 |
# File 'lib/hatefreeweb/client.rb', line 12 def initialize(api_key = nil) @api_key = api_key @api_key ||= Hatefreeweb.api_key @api_path = "" end |
Instance Attribute Details
#api_key ⇒ Object (readonly)
Returns the value of attribute api_key.
9 10 11 |
# File 'lib/hatefreeweb/client.rb', line 9 def api_key @api_key end |
Instance Method Details
#detect(body, lang) ⇒ Object
18 19 20 21 22 |
# File 'lib/hatefreeweb/client.rb', line 18 def detect(body, lang) = {:body => {:body => body, :lang => lang}, :query => self.} results = Mash.new(self.class.post("/detection", )) detection = results. end |