Class: Gurke::Configuration::Inclusion Private

Inherits:
Object
  • Object
show all
Defined in:
lib/gurke/configuration.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(mod, opts) ⇒ Inclusion

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Inclusion.



84
85
86
87
# File 'lib/gurke/configuration.rb', line 84

def initialize(mod, opts)
  @mod  = mod
  @opts = opts
end

Instance Attribute Details

#modObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



82
83
84
# File 'lib/gurke/configuration.rb', line 82

def mod
  @mod
end

#optsObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



82
83
84
# File 'lib/gurke/configuration.rb', line 82

def opts
  @opts
end

Instance Method Details

#match?(tags) ⇒ Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)


97
98
99
100
101
102
103
104
105
# File 'lib/gurke/configuration.rb', line 97

def match?(tags)
  return true if self.tags.empty?

  self.tags.each do |tag|
    return true if tags.include?(tag.to_s)
  end

  false
end

#tagsObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



89
90
91
92
93
94
95
# File 'lib/gurke/configuration.rb', line 89

def tags
  @tags ||= begin
    tags = opts.fetch(:tags, [])
    tags = [tags] unless tags.is_a?(Array)
    tags
  end
end