Class: Fathom::Variable
- Inherits:
-
Object
- Object
- Fathom::Variable
- Extended by:
- Plugins
- Defined in:
- lib/fathom/data/variable.rb
Class Method Summary collapse
Instance Method Summary collapse
- #eql(other) ⇒ Object (also: #==)
-
#initialize(attrs = {}) ⇒ Variable
constructor
A new instance of Variable.
- #underscored_name ⇒ Object
Methods included from Plugins
Constructor Details
#initialize(attrs = {}) ⇒ Variable
Returns a new instance of Variable.
35 36 37 38 39 |
# File 'lib/fathom/data/variable.rb', line 35 def initialize(attrs={}) attrs[:id] ||= UUID.generate @attributes = attrs self.prior_odds ||= uniform_set.dup end |
Class Method Details
Instance Method Details
#eql(other) ⇒ Object Also known as: ==
45 46 47 48 |
# File 'lib/fathom/data/variable.rb', line 45 def eql(other) return false unless other.is_a?(Variable) self.name == other.name end |
#underscored_name ⇒ Object
41 42 43 |
# File 'lib/fathom/data/variable.rb', line 41 def underscored_name name.to_s.gsub(/\W/, "_").underscore end |