Class: Gurke::FeatureList::Filter::TagFilter

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#tagObject

Returns the value of attribute tag

Returns:

  • (Object)

    the current value of tag



94
95
96
# File 'lib/gurke/feature_list.rb', line 94

def tag
  @tag
end

Instance Method Details

#match?(taggable) ⇒ Boolean

Returns:

  • (Boolean)


103
104
105
# File 'lib/gurke/feature_list.rb', line 103

def match?(taggable)
  negated? != taggable.tags.any? {|t| t.name == name }
end

#nameObject



95
96
97
# File 'lib/gurke/feature_list.rb', line 95

def name
  @name ||= negated? ? tag[1..-1] : tag
end

#negated?Boolean

Returns:

  • (Boolean)


99
100
101
# File 'lib/gurke/feature_list.rb', line 99

def negated?
  tag[0] == '~'
end