Class: Blood::Modules
- Inherits:
-
Object
- Object
- Blood::Modules
- Defined in:
- lib/blood.rb
Instance Method Summary collapse
- #add(mod) ⇒ Object
- #eql?(other) ⇒ Boolean
- #hash ⇒ Object
- #to_s ⇒ Object (also: #name)
Instance Method Details
#add(mod) ⇒ Object
28 29 30 |
# File 'lib/blood.rb', line 28 def add(mod) (@mods ||= []) << mod end |
#eql?(other) ⇒ Boolean
42 43 44 |
# File 'lib/blood.rb', line 42 def eql?(other) to_s.eql?(other.to_s) end |
#hash ⇒ Object
38 39 40 |
# File 'lib/blood.rb', line 38 def hash to_s.hash end |
#to_s ⇒ Object Also known as: name
32 33 34 |
# File 'lib/blood.rb', line 32 def to_s @to_s ||= (@mods.count == 1 ? @mods[0].to_s : @mods.to_s) end |