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.



86
87
88
89
# File 'lib/gurke/configuration.rb', line 86

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.



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

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.



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

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)


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

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.



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

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