Class: Symbol

Inherits
Object show all
Defined in
lib/kyanite/fsymbol.rb,
lib/kyanite/symbol.rb,
lib/kyanite/general/classutils.rb

Class Utils

Kyanite definitions

Class, Symbol, String

Kyanite tests and examples

TestKyaniteClassutils

Usage

require 'kyanite/general/classutils'

Core Extensions (collapse)

Class Utils (collapse)

Instance Method Summary (collapse)

Instance Method Details

- (Array) *(n)

like String method with same name

Returns:



30
31
32
33
34
35
36
# File 'lib/kyanite/symbol.rb', line 30

def *(n)
  result = []
  n.times do
    result << self
  end # do
  return result
end

- (Symbol) +(other)

like String method with same name

Returns:



24
25
26
# File 'lib/kyanite/symbol.rb', line 24

def +(other)
  (self.to_s + other.to_s).to_sym
end

- (self) dup

self, you can not dup Symbols

Returns:

  • (self)


20
# File 'lib/kyanite/symbol.rb', line 20

def dup;                            self;            end

- (Object) to_class



194
195
196
# File 'lib/kyanite/general/classutils.rb', line 194

def to_class 
    self.to_s.to_class
end

- (Object) to_classname



189
190
191
# File 'lib/kyanite/general/classutils.rb', line 189

def to_classname 
    self.to_s.to_classname
end

- (Object) to_fsymbol(def_tree = nil)



120
121
122
# File 'lib/kyanite/fsymbol.rb', line 120

def to_fsymbol(def_tree=nil)
  FSymbol.new(self, def_tree)
end