Class: Wildcard::AnythingWildcard

Inherits:
Wildcard show all
Defined in:
lib/like_structure/wildcard.rb

Instance Method Summary collapse

Constructor Details

#initialize(allow_nil) ⇒ AnythingWildcard

Returns a new instance of AnythingWildcard.



15
16
17
# File 'lib/like_structure/wildcard.rb', line 15

def initialize(allow_nil)
  @allow_nil = allow_nil
end

Instance Method Details

#reverse_like?(actual) ⇒ Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/like_structure/wildcard.rb', line 18

def reverse_like?(actual)
  @allow_nil || !actual.nil?
end