Class: Flagship::Features

Inherits:
Array
  • Object
show all
Defined in:
lib/flagship/features.rb

Instance Method Summary collapse

Instance Method Details

#disabledObject



16
17
18
# File 'lib/flagship/features.rb', line 16

def disabled
  self.class.new(select(&:disabled?))
end

#enabledObject



12
13
14
# File 'lib/flagship/features.rb', line 12

def enabled
  self.class.new(select(&:enabled?))
end

#tagged(tags) ⇒ Object Also known as: tagged_all



6
7
8
# File 'lib/flagship/features.rb', line 6

def tagged(tags)
  self.class.new(select{|feature| tags.all?{|tag, val| feature.tags[tag] == val}})
end

#tagged_any(tags) ⇒ Object



2
3
4
# File 'lib/flagship/features.rb', line 2

def tagged_any(tags)
  self.class.new(select{|feature| tags.any?{|tag, val| feature.tags[tag] == val}})
end