module Nova::Common::Features::ClassMethods

Class methods.

Public Instance Methods

feature(name, options = {}, &block) click to toggle source

Define a feature, with the given name and block.

@param name [Symbol] the name of the feature. @param options [Hash] the options for the feature. @yield to create the feature. @return [Feature] the feature that was defined.

# File lib/nova/common/features.rb, line 37
def feature(name, options = {}, &block)
  new_feature = Feature.new(name, options)
  new_feature.instance_exec &block
  features[name] = new_feature
end
features() click to toggle source

The list of features the star supports.

@return [Hash] the features.

# File lib/nova/common/features.rb, line 20
def features
  @features ||= {}
end
supports?(feature_name) click to toggle source

Whether or not this star supports a feature.

@return [Boolean]

# File lib/nova/common/features.rb, line 27
def supports?(feature_name)
  features.key? feature_name
end