Class: FlipTheSwitch::Feature

Inherits:
Struct
  • Object
show all
Defined in:
lib/flip_the_switch/feature.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, enabled, description = nil, sub_features = [], parent_name = nil) ⇒ Feature

Returns a new instance of Feature.



3
4
5
# File 'lib/flip_the_switch/feature.rb', line 3

def initialize(name, enabled, description = nil, sub_features = [], parent_name = nil)
  super(name, enabled, description, sub_features, parent_name)
end

Instance Attribute Details

#descriptionObject

Returns the value of attribute description

Returns:

  • (Object)

    the current value of description



2
3
4
# File 'lib/flip_the_switch/feature.rb', line 2

def description
  @description
end

#enabledObject

Returns the value of attribute enabled

Returns:

  • (Object)

    the current value of enabled



2
3
4
# File 'lib/flip_the_switch/feature.rb', line 2

def enabled
  @enabled
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



2
3
4
# File 'lib/flip_the_switch/feature.rb', line 2

def name
  @name
end

#parent_nameObject

Returns the value of attribute parent_name

Returns:

  • (Object)

    the current value of parent_name



2
3
4
# File 'lib/flip_the_switch/feature.rb', line 2

def parent_name
  @parent_name
end

#sub_featuresObject

Returns the value of attribute sub_features

Returns:

  • (Object)

    the current value of sub_features



2
3
4
# File 'lib/flip_the_switch/feature.rb', line 2

def sub_features
  @sub_features
end

Instance Method Details

#has_parent?Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/flip_the_switch/feature.rb', line 7

def has_parent?
  parent_name
end