-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from Krystosterone/code-cleanup
Code cleanup
- Loading branch information
Showing
16 changed files
with
120 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
class MollomRestApi::V1::Captcha < MollomRestApi::Interface | ||
def self.create(type = 'image', request_parameters = {}) | ||
post(request_parameters.reverse_merge(type: type)) | ||
end | ||
class << self | ||
def create(type = 'image', request_parameters = {}) | ||
post(request_parameters.reverse_merge(type: type)) | ||
end | ||
|
||
def self.verify(captcha_id, solution, request_parameters = {}) | ||
post(request_parameters.reverse_merge(solution: solution), captcha_id) | ||
def verify(captcha_id, solution, request_parameters = {}) | ||
post(request_parameters.reverse_merge(solution: solution), captcha_id) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
class MollomRestApi::V1::Content < MollomRestApi::Interface | ||
def self.check(request_parameters = {}) | ||
post(request_parameters) | ||
end | ||
class << self | ||
def create(request_parameters = {}) | ||
post(request_parameters) | ||
end | ||
alias_method :check, :create | ||
|
||
def self.update(content_id, request_parameters = {}) | ||
post(request_parameters, [content_id]) | ||
def update(content_id, request_parameters = {}) | ||
post(request_parameters, [content_id]) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,23 @@ | ||
class MollomRestApi::V1::Site < MollomRestApi::Interface | ||
def self.create(url, email, request_parameters = {}) | ||
post(request_parameters.reverse_merge(url: url, email: email)) | ||
end | ||
class << self | ||
def create(url, email, request_parameters = {}) | ||
post(request_parameters.reverse_merge(url: url, email: email)) | ||
end | ||
|
||
def self.update(public_key, request_parameters = {}) | ||
post(request_parameters, [public_key]) | ||
end | ||
def update(public_key, request_parameters = {}) | ||
post(request_parameters, [public_key]) | ||
end | ||
|
||
def self.list(request_parameters = {}) | ||
get(request_parameters) | ||
end | ||
def list(request_parameters = {}) | ||
get(request_parameters) | ||
end | ||
|
||
def self.read(public_key) | ||
get({}, [public_key]) | ||
end | ||
def read(public_key) | ||
get({}, [public_key]) | ||
end | ||
|
||
def self.delete(public_key) | ||
post({}, [public_key]) | ||
def delete(public_key) | ||
post({}, [public_key]) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,29 @@ | ||
class MollomRestApi::V1::Whitelist < MollomRestApi::Interface | ||
class << self | ||
def create(public_key, value, context, request_parameters = {}) | ||
post(request_parameters.reverse_merge(value: value, context: context), [public_key]) | ||
end | ||
|
||
def self.create(public_key, value, context, request_parameters = {}) | ||
post(request_parameters.reverse_merge(value: value, context: context), [public_key]) | ||
end | ||
|
||
def self.update(public_key, whitelist_entry_id, request_parameters = {}) | ||
post(request_parameters, [public_key, whitelist_entry_id]) | ||
end | ||
def update(public_key, whitelist_entry_id, request_parameters = {}) | ||
post(request_parameters, [public_key, whitelist_entry_id]) | ||
end | ||
|
||
def self.delete(public_key, whitelist_entry_id) | ||
post({}, [public_key, whitelist_entry_id]) | ||
end | ||
def delete(public_key, whitelist_entry_id) | ||
post({}, [public_key, whitelist_entry_id]) | ||
end | ||
|
||
def self.list(public_key, request_parameters = {}) | ||
get(request_parameters, [public_key]) | ||
end | ||
def list(public_key, request_parameters = {}) | ||
get(request_parameters, [public_key]) | ||
end | ||
|
||
def self.read(public_key, whitelist_entry_id) | ||
get({}, [public_key, whitelist_entry_id]) | ||
end | ||
def read(public_key, whitelist_entry_id) | ||
get({}, [public_key, whitelist_entry_id]) | ||
end | ||
|
||
class << self | ||
protected | ||
|
||
def results_key | ||
'entry' | ||
end | ||
end | ||
|
||
end |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.