Class: Aikido::Zen::AttackWave::Sample
- Inherits:
-
Object
- Object
- Aikido::Zen::AttackWave::Sample
- Defined in:
- lib/aikido/zen/attack_wave.rb
Instance Attribute Summary collapse
- #path ⇒ String readonly
- #verb ⇒ String readonly
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?)
- #as_json ⇒ Object
- #hash ⇒ Object
-
#initialize(verb:, path:) ⇒ Sample
constructor
A new instance of Sample.
Constructor Details
#initialize(verb:, path:) ⇒ Sample
Returns a new instance of Sample.
126 127 128 129 |
# File 'lib/aikido/zen/attack_wave.rb', line 126 def initialize(verb:, path:) @verb = verb @path = path end |
Instance Attribute Details
#path ⇒ String (readonly)
124 125 126 |
# File 'lib/aikido/zen/attack_wave.rb', line 124 def path @path end |
#verb ⇒ String (readonly)
121 122 123 |
# File 'lib/aikido/zen/attack_wave.rb', line 121 def verb @verb end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
138 139 140 141 142 |
# File 'lib/aikido/zen/attack_wave.rb', line 138 def ==(other) other.is_a?(self.class) && other.verb == verb && other.path == path end |
#as_json ⇒ Object
131 132 133 134 135 136 |
# File 'lib/aikido/zen/attack_wave.rb', line 131 def as_json { method: @verb.as_json, url: @path.as_json }.compact end |
#hash ⇒ Object
145 146 147 |
# File 'lib/aikido/zen/attack_wave.rb', line 145 def hash [verb, path].hash end |