Class: Blood::Modules

Inherits:
Object
  • Object
show all
Defined in:
lib/blood.rb

Instance Method Summary collapse

Instance Method Details

#add(mod) ⇒ Object



28
29
30
# File 'lib/blood.rb', line 28

def add(mod)
  (@mods ||= []) << mod
end

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


42
43
44
# File 'lib/blood.rb', line 42

def eql?(other)
  to_s.eql?(other.to_s)
end

#hashObject



38
39
40
# File 'lib/blood.rb', line 38

def hash
  to_s.hash
end

#to_sObject 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