Class: StopForumSpam::Client
- Inherits:
-
Object
- Object
- StopForumSpam::Client
- Includes:
- HTTParty
- Defined in:
- lib/stop_forum_spam/client.rb
Instance Attribute Summary collapse
-
#api_key ⇒ Object
Returns the value of attribute api_key.
Instance Method Summary collapse
- #get(options = {}) ⇒ Object
-
#initialize(api_key = nil) ⇒ Client
constructor
A new instance of Client.
- #post(options = {}) ⇒ Object
Constructor Details
#initialize(api_key = nil) ⇒ Client
Returns a new instance of Client.
9 10 11 |
# File 'lib/stop_forum_spam/client.rb', line 9 def initialize(api_key=nil) @api_key = api_key end |
Instance Attribute Details
#api_key ⇒ Object
Returns the value of attribute api_key.
7 8 9 |
# File 'lib/stop_forum_spam/client.rb', line 7 def api_key @api_key end |
Instance Method Details
#get(options = {}) ⇒ Object
21 22 23 |
# File 'lib/stop_forum_spam/client.rb', line 21 def get(={}) self.class.get('/api', ) end |
#post(options = {}) ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/stop_forum_spam/client.rb', line 13 def post(={}) self.class.post('/post.php', :body => {:ip_addr => [:ip_address], :email=> [:email], :username => [:username], :api_key => api_key}) end |