Class: Cooltrainer::DistorteD::KEY
- Inherits:
-
Struct
- Object
- Struct
- Cooltrainer::DistorteD::KEY
- Defined in:
- lib/distorted/media_molecule.rb
Overview
Reusable IMPLANTATION Hash key, since instances of the same Struct subclass are equal: irb> Pair = Struct.new(:uno, :dos) irb> lol = Pair.new(:a, 1) irb> rofl = Pair.new(:a, 1) irb> lol === rofl
> true
Instance Attribute Summary collapse
-
#constant ⇒ Object
Returns the value of attribute constant.
-
#inherit ⇒ Object
Returns the value of attribute inherit.
-
#molecule ⇒ Object
Returns the value of attribute molecule.
Instance Method Summary collapse
-
#initialize(molecule, constant, inherit = true) ⇒ KEY
constructor
Descend into ancestor Modules by default.
- #inspect ⇒ Object
Constructor Details
#initialize(molecule, constant, inherit = true) ⇒ KEY
Descend into ancestor Modules by default.
28 |
# File 'lib/distorted/media_molecule.rb', line 28 def initialize(molecule, constant, inherit = true); super(molecule, constant, inherit); end |
Instance Attribute Details
#constant ⇒ Object
Returns the value of attribute constant
26 27 28 |
# File 'lib/distorted/media_molecule.rb', line 26 def constant @constant end |
#inherit ⇒ Object
Returns the value of attribute inherit
26 27 28 |
# File 'lib/distorted/media_molecule.rb', line 26 def inherit @inherit end |
#molecule ⇒ Object
Returns the value of attribute molecule
26 27 28 |
# File 'lib/distorted/media_molecule.rb', line 26 def molecule @molecule end |
Instance Method Details
#inspect ⇒ Object
29 |
# File 'lib/distorted/media_molecule.rb', line 29 def inspect; "#{molecule}#{'∫'.freeze if inherit}::#{constant}"; end |