Module: FeatureToggle::Syntax::Shared

Included in:
Feature, State
Defined in:
lib/feature_toggle/syntax/shared.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



4
5
6
# File 'lib/feature_toggle/syntax/shared.rb', line 4

def self.included(base)
  base.send :attr_reader, :name
end

Instance Method Details

#desc(description = nil) ⇒ Object



13
14
15
16
17
# File 'lib/feature_toggle/syntax/shared.rb', line 13

def desc(description = nil)
  return @desc if description.blank?

  @desc = description
end

#initialize(name, block = nil) ⇒ Object



8
9
10
11
# File 'lib/feature_toggle/syntax/shared.rb', line 8

def initialize(name, block = nil)
  @name = name
  instance_eval(&block) if block.is_a? Proc
end