Skip to content

Commit

Permalink
Fix coding style issues
Browse files Browse the repository at this point in the history
  • Loading branch information
aldesantis committed Dec 20, 2016
1 parent faa1d0b commit 7d5676d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 15 deletions.
4 changes: 1 addition & 3 deletions lib/pragma/operation/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ def inherited(child)
include Validation

before :setup_context

around :handle_halt
end
end
Expand Down Expand Up @@ -141,7 +140,6 @@ def with_hooks
# rescued by the operation.
#
# @author Alessandro Desantis
class Halt < StandardError
end
Halt = Class.new(StandardError)
end
end
24 changes: 12 additions & 12 deletions lib/pragma/operation/status.rb
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
# frozen_string_literal: true
module Pragma
module Operation
# This error is raised when an invalid status is set for an operation.
#
# @author Alessandro Desantis
class InvalidStatusError < StandardError
# Initializes the error.
#
# @param [Integer|Symbol] an invalid HTTP status code
def initialize(status)
super "'#{status}' is not a valid HTTP status code."
end
end

module Status
STATUSES = {
200 => :ok,
Expand Down Expand Up @@ -109,5 +97,17 @@ def mark_result
context.fail!
end
end

# This error is raised when an invalid status is set for an operation.
#
# @author Alessandro Desantis
class InvalidStatusError < StandardError
# Initializes the error.
#
# @param [Integer|Symbol] an invalid HTTP status code
def initialize(status)
super "'#{status}' is not a valid HTTP status code."
end
end
end
end

0 comments on commit 7d5676d

Please sign in to comment.