Class: Peck::Rails::Controller::Status
- Inherits:
-
Object
- Object
- Peck::Rails::Controller::Status
- Defined in:
- lib/peck_on_rails.rb
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(response) ⇒ Status
constructor
A new instance of Status.
- #inspect ⇒ Object
Constructor Details
#initialize(response) ⇒ Status
Returns a new instance of Status.
144 145 146 |
# File 'lib/peck_on_rails.rb', line 144 def initialize(response) @response = response end |
Instance Method Details
#==(other) ⇒ Object
148 149 150 151 152 153 154 155 156 |
# File 'lib/peck_on_rails.rb', line 148 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
158 159 160 |
# File 'lib/peck_on_rails.rb', line 158 def inspect "#<Peck::Rails::Controller::Status:#{@response.status}>" end |