Class: CodeUnion::API
- Inherits:
-
Object
- Object
- CodeUnion::API
- Defined in:
- lib/codeunion/api.rb
Overview
A simple module for interacting with the CodeUnion API
Instance Attribute Summary collapse
-
#http_client ⇒ Object
readonly
Returns the value of attribute http_client.
Instance Method Summary collapse
-
#initialize(host, version) ⇒ API
constructor
A new instance of API.
- #search(params = {}) ⇒ Object
Constructor Details
#initialize(host, version) ⇒ API
Returns a new instance of API.
8 9 10 |
# File 'lib/codeunion/api.rb', line 8 def initialize(host, version) @http_client = HTTPClient.new("http://#{host}/#{version}") end |
Instance Attribute Details
#http_client ⇒ Object (readonly)
Returns the value of attribute http_client.
7 8 9 |
# File 'lib/codeunion/api.rb', line 7 def http_client @http_client end |
Instance Method Details
#search(params = {}) ⇒ Object
12 13 14 |
# File 'lib/codeunion/api.rb', line 12 def search(params = {}) http_client.get("search", params) end |