Class: Symbol

Inherits:
Object show all
Defined in:
lib/rmtools/core/symbol.rb

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object



14
15
16
17
18
19
20
# File 'lib/rmtools/core/symbol.rb', line 14

def method_missing(method, *args, &block)
  if ''.respond_to? method
    to_s.__send__ method, *args, &block
  else
    throw_no method
  end
end

Instance Method Details

#+(str) ⇒ Object



4
5
6
# File 'lib/rmtools/core/symbol.rb', line 4

def +(str)
  to_s + str
end

#split(splitter = '_') ⇒ Object Also known as: /



8
9
10
# File 'lib/rmtools/core/symbol.rb', line 8

def split(splitter='_')
  to_s.split splitter
end

#throw_noObject



13
# File 'lib/rmtools/core/symbol.rb', line 13

alias :throw_no :method_missing