Class: Distribution
- Inherits:
-
Object
- Object
- Distribution
- Defined in:
- lib/catlogic/distribution.rb
Instance Attribute Summary collapse
-
#label ⇒ Object
readonly
Returns the value of attribute label.
Instance Method Summary collapse
-
#initialize(distribution) ⇒ Distribution
constructor
A new instance of Distribution.
- #opposite ⇒ Object
Constructor Details
#initialize(distribution) ⇒ Distribution
Returns a new instance of Distribution.
4 5 6 |
# File 'lib/catlogic/distribution.rb', line 4 def initialize(distribution) @label = distribution end |
Instance Attribute Details
#label ⇒ Object (readonly)
Returns the value of attribute label.
2 3 4 |
# File 'lib/catlogic/distribution.rb', line 2 def label @label end |
Instance Method Details
#opposite ⇒ Object
8 9 10 11 12 13 14 15 |
# File 'lib/catlogic/distribution.rb', line 8 def opposite if self.label == 'distributed' opposite = Distribution.new('undistributed') elsif self.label == 'undistributed' opposite = Distribution.new('distributed') end return opposite end |