Class: Turbo::SystemTestHelper::SignedStreamNameConditions

Inherits:
Object
  • Object
show all
Includes:
Enumerable, Turbo::Streams::StreamName
Defined in:
lib/turbo/system_test_helper.rb

Overview

:nodoc:

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ SignedStreamNameConditions

Returns a new instance of SignedStreamNameConditions.



109
110
111
# File 'lib/turbo/system_test_helper.rb', line 109

def initialize(value)
  @value = value
end

Instance Method Details

#attributeObject



113
114
115
# File 'lib/turbo/system_test_helper.rb', line 113

def attribute
  XPath.attr(:"signed-stream-name")
end

#eachObject



117
118
119
120
121
122
123
124
125
126
# File 'lib/turbo/system_test_helper.rb', line 117

def each
  if @value.is_a?(String)
    yield attribute == @value
    yield attribute == signed_stream_name(@value)
  elsif @value.is_a?(Array) || @value.respond_to?(:to_key)
    yield attribute == signed_stream_name(@value)
  elsif @value.present?
    yield attribute == @value
  end
end