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.



106
107
108
109
# File 'lib/gurke/configuration.rb', line 106

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.



104
105
106
# File 'lib/gurke/configuration.rb', line 104

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.



104
105
106
# File 'lib/gurke/configuration.rb', line 104

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)


119
120
121
122
123
124
125
126
127
# File 'lib/gurke/configuration.rb', line 119

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.



111
112
113
114
115
116
117
# File 'lib/gurke/configuration.rb', line 111

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