Class: GaroonCat::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/garoon-cat/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#passwordObject (readonly)

Returns the value of attribute password.



6
7
8
# File 'lib/garoon-cat/client.rb', line 6

def password
  @password
end

#usernameObject (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