lib/eatabit_rails/rest/uri.rb in eatabit_rails-0.2.0 vs lib/eatabit_rails/rest/uri.rb in eatabit_rails-0.2.1
- old
+ new
@@ -1,24 +1,23 @@
-module EatabitRails
+# frozen_string_literal: true
+module EatabitRails
module REST
-
class Uri
-
def self.default_params
{
content_type: :json,
accept: :json
}
end
def initialize
- @sid = EatabitRails.configuration.sid
- @token = EatabitRails.configuration.token
+ @sid = EatabitRails.configuration.sid
+ @token = EatabitRails.configuration.token
@protocol = EatabitRails::REST::Config::PROTOCOL
- @host = EatabitRails::REST::Config::HOST
- @version = EatabitRails.configuration.version || EatabitRails::REST::Config::VERSION
+ @host = EatabitRails::REST::Config::HOST
+ @version = EatabitRails.configuration.version || EatabitRails::REST::Config::VERSION
end
def base_uri
[
@protocol,
@@ -47,16 +46,13 @@
uri = [
printer(printer_id),
'jobs'
]
- if job_id
- uri.push job_id
- end
-
+ uri.push(job_id) if job_id
uri.join('/')
end
- alias :account :base_uri
+ alias account base_uri
end
end
end