Module: Nova::Common::Features::ClassMethods
- Included in:
- Star
- Defined in:
- lib/nova/common/features.rb
Overview
Class methods.
Instance Method Summary collapse
-
#feature(name, options = {}) { ... } ⇒ Feature
Define a feature, with the given name and block.
-
#features ⇒ Hash
The list of features the star supports.
-
#supports?(feature_name) ⇒ Boolean
Whether or not this star supports a feature.
Instance Method Details
#feature(name, options = {}) { ... } ⇒ Feature
Define a feature, with the given name and block.
37 38 39 40 41 |
# File 'lib/nova/common/features.rb', line 37 def feature(name, = {}, &block) new_feature = Feature.new(name, ) new_feature.instance_exec &block features[name] = new_feature end |
#features ⇒ Hash
The list of features the star supports.
20 21 22 |
# File 'lib/nova/common/features.rb', line 20 def features @features ||= {} end |
#supports?(feature_name) ⇒ Boolean
Whether or not this star supports a feature.
27 28 29 |
# File 'lib/nova/common/features.rb', line 27 def supports?(feature_name) features.key? feature_name end |