Class: GaroonCat::Client
- Inherits:
-
Object
- Object
- GaroonCat::Client
- Defined in:
- lib/garoon-cat/client.rb
Instance Attribute Summary collapse
-
#password ⇒ Object
readonly
Returns the value of attribute password.
-
#username ⇒ Object
readonly
Returns the value of attribute username.
Instance Method Summary collapse
- #get(uri) ⇒ Object
-
#initialize(username: nil, password: nil) ⇒ Client
constructor
A new instance of Client.
- #post(uri, data) ⇒ Object
Constructor Details
#initialize(username: nil, password: nil) ⇒ Client
Returns a new instance of Client.
8 9 10 11 12 |
# File 'lib/garoon-cat/client.rb', line 8 def initialize(username:nil, password:nil) @client = HTTPClient.new @username = username @password = password end |
Instance Attribute Details
#password ⇒ Object (readonly)
Returns the value of attribute password.
6 7 8 |
# File 'lib/garoon-cat/client.rb', line 6 def password @password end |
#username ⇒ Object (readonly)
Returns the value of attribute username.
5 6 7 |
# File 'lib/garoon-cat/client.rb', line 5 def username @username end |
Instance Method Details
#get(uri) ⇒ Object
14 15 16 |
# File 'lib/garoon-cat/client.rb', line 14 def get(uri) @client.get_content(uri) end |
#post(uri, data) ⇒ Object
18 19 20 |
# File 'lib/garoon-cat/client.rb', line 18 def post(uri, data) @client.post_content(uri, data) end |