Class: Flagship::Features
- Inherits:
-
Array
- Object
- Array
- Flagship::Features
- Defined in:
- lib/flagship/features.rb
Instance Method Summary collapse
- #disabled ⇒ Object
- #enabled ⇒ Object
- #tagged(tags) ⇒ Object (also: #tagged_all)
- #tagged_any(tags) ⇒ Object
Instance Method Details
#disabled ⇒ Object
16 17 18 |
# File 'lib/flagship/features.rb', line 16 def disabled self.class.new(select(&:disabled?)) end |
#enabled ⇒ Object
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() self.class.new(select{|feature| .all?{|tag, val| feature.[tag] == val}}) end |
#tagged_any(tags) ⇒ Object
2 3 4 |
# File 'lib/flagship/features.rb', line 2 def tagged_any() self.class.new(select{|feature| .any?{|tag, val| feature.[tag] == val}}) end |