Class: Peck::Rails::Controller::Status
- Inherits:
-
Object
- Object
- Peck::Rails::Controller::Status
- Defined in:
- lib/peck_on_rails/controller.rb
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?)
-
#initialize(response) ⇒ Status
constructor
A new instance of Status.
- #inspect ⇒ Object
Constructor Details
#initialize(response) ⇒ Status
Returns a new instance of Status.
94 95 96 |
# File 'lib/peck_on_rails/controller.rb', line 94 def initialize(response) @response = response end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
98 99 100 101 102 103 104 105 106 |
# File 'lib/peck_on_rails/controller.rb', line 98 def ==(other) case other when Numeric @response.status == other else code = Rack::Utils::SYMBOL_TO_STATUS_CODE[other] @response.status === code end end |
#inspect ⇒ Object
110 111 112 |
# File 'lib/peck_on_rails/controller.rb', line 110 def inspect "#<Peck::Rails::Controller::Status:#{@response.status}>" end |