Class: Usher::Route::RequestMethod
- Inherits:
-
Object
- Object
- Usher::Route::RequestMethod
- Defined in:
- lib/usher/route/request_method.rb
Instance Attribute Summary collapse
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #eql?(o) ⇒ Boolean (also: #==)
- #hash ⇒ Object
-
#initialize(type, value) ⇒ RequestMethod
constructor
A new instance of RequestMethod.
- #trivial? ⇒ Boolean
Constructor Details
#initialize(type, value) ⇒ RequestMethod
Returns a new instance of RequestMethod.
7 8 9 10 |
# File 'lib/usher/route/request_method.rb', line 7 def initialize(type, value) @type = type @value = value end |
Instance Attribute Details
#type ⇒ Object (readonly)
Returns the value of attribute type.
5 6 7 |
# File 'lib/usher/route/request_method.rb', line 5 def type @type end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
5 6 7 |
# File 'lib/usher/route/request_method.rb', line 5 def value @value end |
Instance Method Details
#eql?(o) ⇒ Boolean Also known as: ==
16 17 18 |
# File 'lib/usher/route/request_method.rb', line 16 def eql?(o) o.is_a?(self.class) && o.type == type && o.value == value end |
#hash ⇒ Object
12 13 14 |
# File 'lib/usher/route/request_method.rb', line 12 def hash type.hash + value.hash end |
#trivial? ⇒ Boolean
21 22 23 |
# File 'lib/usher/route/request_method.rb', line 21 def trivial? value.nil? end |