Class: Usher::Route::RequestMethod

Inherits:
Object
  • Object
show all
Defined in:
lib/usher/route/request_method.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#typeObject (readonly)

Returns the value of attribute type.



5
6
7
# File 'lib/usher/route/request_method.rb', line 5

def type
  @type
end

#valueObject (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: ==

Returns:

  • (Boolean)


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

#hashObject



12
13
14
# File 'lib/usher/route/request_method.rb', line 12

def hash
  type.hash + value.hash
end

#trivial?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/usher/route/request_method.rb', line 21

def trivial?
  value.nil?
end