Method: Warp::Dir::App::Response#type

Defined in:
lib/warp/dir/app/response.rb

#type(a_type = nil) ⇒ Object



96
97
98
99
100
101
102
103
104
# File 'lib/warp/dir/app/response.rb', line 96

def type(a_type = nil)
  if a_type
    @type = a_type.kind_of?(Warp::Dir::App::Response::Type) ? a_type : RETURN_TYPE[a_type]
    raise(::ArgumentError.new("Can't find response type #{a_type} #{@type}")) unless @type
    self
  else
    @type
  end
end