Module: Webbed::Helpers::MethodHelper

Included in:
Request
Defined in:
lib/webbed/helpers/method_helper.rb

Overview

Request helper for the Method

Instance Method Summary collapse

Instance Method Details

#connect?Boolean

Whether or not the Request uses the CONNECT Method

Returns:

  • (Boolean)


71
72
73
# File 'lib/webbed/helpers/method_helper.rb', line 71

def connect?
  method == 'CONNECT'
end

#delete?Boolean

Whether or not the Request uses the DELETE Method

Returns:

  • (Boolean)


57
58
59
# File 'lib/webbed/helpers/method_helper.rb', line 57

def delete?
  method == 'DELETE'
end

#get?Boolean

Whether or not the Request uses the GET Method

Returns:

  • (Boolean)


29
30
31
# File 'lib/webbed/helpers/method_helper.rb', line 29

def get?
  method == 'GET'
end

#head?Boolean

Whether or not the Request uses the HEAD Method

Returns:

  • (Boolean)


36
37
38
# File 'lib/webbed/helpers/method_helper.rb', line 36

def head?
  method == 'HEAD'
end

#idempotent?Boolean

Whether or not the Request is idempotent based on the Method

Returns:

  • (Boolean)


15
16
17
# File 'lib/webbed/helpers/method_helper.rb', line 15

def idempotent?
  method.idempotent?
end

#options?Boolean

Whether or not the Request uses the OPTIONS Method

Returns:

  • (Boolean)


22
23
24
# File 'lib/webbed/helpers/method_helper.rb', line 22

def options?
  method == 'OPTIONS'
end

#patch?Boolean

Whether or not the Request uses the PATCH Method

Returns:

  • (Boolean)


78
79
80
# File 'lib/webbed/helpers/method_helper.rb', line 78

def patch?
  method == 'PATCH'
end

#post?Boolean

Whether or not the Request uses the POST Method

Returns:

  • (Boolean)


43
44
45
# File 'lib/webbed/helpers/method_helper.rb', line 43

def post?
  method == 'POST'
end

#put?Boolean

Whether or not the Request uses the PUT Method

Returns:

  • (Boolean)


50
51
52
# File 'lib/webbed/helpers/method_helper.rb', line 50

def put?
  method == 'PUT'
end

#safe?Boolean

Whether or not the Request is safe based on the Method

Returns:

  • (Boolean)


8
9
10
# File 'lib/webbed/helpers/method_helper.rb', line 8

def safe?
  method.safe?
end

#trace?Boolean

Whether or not the Request uses the TRACE Method

Returns:

  • (Boolean)


64
65
66
# File 'lib/webbed/helpers/method_helper.rb', line 64

def trace?
  method == 'TRACE'
end