Skip to content
This repository was archived by the owner on Oct 6, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/reamaze_api.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "reamaze_api/version"
require "reamaze_api/utils"
require "reamaze_api/error"
Expand Down
2 changes: 2 additions & 0 deletions lib/reamaze_api/article.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module ReamazeAPI
class Article < Resource
# Public: Retrieves KB articles.
Expand Down
2 changes: 2 additions & 0 deletions lib/reamaze_api/channel.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module ReamazeAPI
class Channel < Resource
# Public: Retrieves channels.
Expand Down
2 changes: 2 additions & 0 deletions lib/reamaze_api/client.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "faraday_middleware"
require "uri"

Expand Down
2 changes: 2 additions & 0 deletions lib/reamaze_api/contact.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module ReamazeAPI
class Contact < Resource
# Public: Retrieve contacts.
Expand Down
2 changes: 2 additions & 0 deletions lib/reamaze_api/conversation.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module ReamazeAPI
class Conversation < Resource
# Public: Retrieve conversations.
Expand Down
15 changes: 10 additions & 5 deletions lib/reamaze_api/error.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module ReamazeAPI
# Encapsulates HTTP errors that may be returned by the Reamaze API. All API
# errors inherit from this class.
Expand Down Expand Up @@ -45,11 +47,14 @@ def initialize(response = nil)
def build_message
return if @response.nil?

message = "#{@response[:method].to_s.upcase} "
message << "#{@response[:url]}: "
message << "#{@response[:status]}"
message << "\n\nBODY: #{@response[:body].inspect}" if @response[:body]
message
message = [].tap do |msg|
msg << "#{@response[:method].to_s.upcase} "
msg << "#{@response[:url]}: "
msg << "#{@response[:status]}"
msg << "\n\nBODY: #{@response[:body].inspect}" if @response[:body]
end

message.join("")
end
end

Expand Down
2 changes: 2 additions & 0 deletions lib/reamaze_api/message.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module ReamazeAPI
class Message < Resource
# Public: Retrieves messages.
Expand Down
2 changes: 2 additions & 0 deletions lib/reamaze_api/resource.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "forwardable"

module ReamazeAPI
Expand Down
2 changes: 2 additions & 0 deletions lib/reamaze_api/utils.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "reamaze_api/utils/hash_keys"

module ReamazeAPI
Expand Down
2 changes: 2 additions & 0 deletions lib/reamaze_api/utils/hash_keys.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module ReamazeAPI
module Utils
module HashKeys
Expand Down
2 changes: 2 additions & 0 deletions lib/reamaze_api/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module ReamazeAPI
VERSION = "0.7.1"
end