class Nova::Common::Features::Feature

The information about the feature that was defined.

Attributes

name[RW]

The name of the feature.

@return [Symbol]

options[RW]

The options of the feature.

@return [Hash]

Public Class Methods

new(name, options) click to toggle source
# File lib/nova/common/features/feature.rb, line 18
def initialize(name, options)
  @name = name
  @options = options
  @bind = Object.new
  @fake = false
end

Public Instance Methods

disable!() click to toggle source

Disables the feature and runs the :disable event, if it exists.

@return [nil, Object]

# File lib/nova/common/features/feature.rb, line 39
def disable!
  run(:disable)
end
enable!() click to toggle source

Enables the feature and runs the :enable event, if it exists.

@return [nil, Object]

# File lib/nova/common/features/feature.rb, line 31
def enable!
  run(:enable)
end
fake!() click to toggle source

Marks this feature as fake. This is not reversable.

@see fake? @return [self]

# File lib/nova/common/features/feature.rb, line 57
def fake!
  @fake = true
  self
end
fake?() click to toggle source

Whether or not this feature is fake. By fake, it means that it was not created with the defining class as a feature; it does not have any events at all, and its only purpose is to mock the behavior of a real, defined feature.

@return [Boolean]

# File lib/nova/common/features/feature.rb, line 49
def fake?
  @fake
end