Class: FriendlyScore::Endpoints::Base
- Inherits:
-
Object
- Object
- FriendlyScore::Endpoints::Base
- Defined in:
- lib/friendly_score/endpoints/base.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(application_id, application_secret, responder) ⇒ Base
constructor
A new instance of Base.
- #perform(*args) ⇒ Object
Constructor Details
#initialize(application_id, application_secret, responder) ⇒ Base
Returns a new instance of Base.
4 5 6 7 8 |
# File 'lib/friendly_score/endpoints/base.rb', line 4 def initialize application_id, application_secret, responder @application_id = application_id @application_secret = application_secret @responder = responder end |
Instance Method Details
#perform(*args) ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/friendly_score/endpoints/base.rb', line 10 def perform *args code, body = make_request args case code when "200" then process_response body when "404" then process_error body else raise Errors::ServerError end end |