Class: Zenlish::Feature::FeatureDef
- Inherits:
-
Object
- Object
- Zenlish::Feature::FeatureDef
- Defined in:
- lib/zenlish/feature/feature_def.rb
Instance Attribute Summary collapse
-
#default ⇒ FeatureValue
readonly
The default value for the feature.
-
#domain ⇒ FeatureDomain
readonly
The set of potential values the feature can take.
-
#name ⇒ String
readonly
The name of the feature.
Instance Method Summary collapse
-
#initialize(aName, aDomain, aDefault = nil) ⇒ FeatureDef
constructor
A new instance of FeatureDef.
Constructor Details
#initialize(aName, aDomain, aDefault = nil) ⇒ FeatureDef
Returns a new instance of FeatureDef.
20 21 22 23 24 |
# File 'lib/zenlish/feature/feature_def.rb', line 20 def initialize(aName, aDomain, aDefault = nil) @name = validated_name(aName) @domain = aDomain @default = validated_default(domain, aDefault) end |
Instance Attribute Details
#default ⇒ FeatureValue (readonly)
Returns the default value for the feature.
15 16 17 |
# File 'lib/zenlish/feature/feature_def.rb', line 15 def default @default end |
#domain ⇒ FeatureDomain (readonly)
Returns the set of potential values the feature can take.
12 13 14 |
# File 'lib/zenlish/feature/feature_def.rb', line 12 def domain @domain end |
#name ⇒ String (readonly)
Returns the name of the feature.
9 10 11 |
# File 'lib/zenlish/feature/feature_def.rb', line 9 def name @name end |