Class: FuzzyRealty::Parameter
- Inherits:
-
Object
- Object
- FuzzyRealty::Parameter
- Defined in:
- lib/classes.rb
Instance Attribute Summary collapse
-
#desired ⇒ Object
readonly
Returns the value of attribute desired.
-
#required ⇒ Object
readonly
Returns the value of attribute required.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Class Method Summary collapse
-
.valid_types ⇒ Object
A valid type is any of the ones there is a weight for.
Instance Method Summary collapse
-
#initialize(type, desired, required = false) ⇒ Parameter
constructor
A new instance of Parameter.
Constructor Details
#initialize(type, desired, required = false) ⇒ Parameter
Returns a new instance of Parameter.
34 35 36 37 38 39 40 41 |
# File 'lib/classes.rb', line 34 def initialize(type,desired,required=false) if !Parameter.valid_types.contains(type) raise "Attempting to create non-existant Parameter type" end @type = type @desired = desired @required = required end |
Instance Attribute Details
#desired ⇒ Object (readonly)
Returns the value of attribute desired.
33 34 35 |
# File 'lib/classes.rb', line 33 def desired @desired end |
#required ⇒ Object (readonly)
Returns the value of attribute required.
33 34 35 |
# File 'lib/classes.rb', line 33 def required @required end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
33 34 35 |
# File 'lib/classes.rb', line 33 def type @type end |
Class Method Details
.valid_types ⇒ Object
A valid type is any of the ones there is a weight for.
44 45 46 |
# File 'lib/classes.rb', line 44 def self.valid_types FuzzyRealty::WEIGHTS.each_key.to_a end |