Class: Hotwire::Response::Invalid

Inherits:
Base
  • Object
show all
Defined in:
lib/hotwire/response/invalid.rb

Overview

Represents an invalid set of parameters. This is used only to guarantee a return value from the factory methods, even when parameters are wrong.

Invoking valid? on this class will sistematically return false.

Instance Attribute Summary

Attributes inherited from Base

#columns, #data

Attributes inherited from Base

#errors

Instance Method Summary collapse

Methods inherited from Base

#add_column, #add_columns, #body, #set_data

Methods inherited from Base

#add_error, #valid?, #validate

Constructor Details

#initialize(request) ⇒ Invalid

Returns a new instance of Invalid.



8
9
10
11
12
13
# File 'lib/hotwire/response/invalid.rb', line 8

def initialize(request)
  super(request)
  add_error(:invalid_request, 
            "Invalid output format: #{request[:out]}. " +
            "Valid ones are json,csv,html")
end