Class: Arti::Connection
- Inherits:
-
Object
- Object
- Arti::Connection
- Defined in:
- lib/arti/connection.rb
Instance Attribute Summary collapse
-
#conn ⇒ Object
readonly
Returns the value of attribute conn.
Instance Method Summary collapse
- #get(uri) ⇒ Object
-
#initialize(args) ⇒ Connection
constructor
A new instance of Connection.
Constructor Details
#initialize(args) ⇒ Connection
Returns a new instance of Connection.
6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/arti/connection.rb', line 6 def initialize(args) @endpoint = args[:endpoint] @user = args[:user] @password = args[:password] @conn = Faraday.new(:url => @endpoint) do |f| f.request :url_encoded f.request :basic_auth, @user, @password f.response :logger f.adapter Faraday.default_adapter end end |
Instance Attribute Details
#conn ⇒ Object (readonly)
Returns the value of attribute conn.
5 6 7 |
# File 'lib/arti/connection.rb', line 5 def conn @conn end |
Instance Method Details
#get(uri) ⇒ Object
19 20 21 |
# File 'lib/arti/connection.rb', line 19 def get(uri) conn.get(uri) end |