Class: Symbol

Inherits:
Object
  • Object
show all
Defined in:
lib/clir/Symbol.ext.rb

Instance Method Summary collapse

Instance Method Details

#camelizeObject



16
17
18
# File 'lib/clir/Symbol.ext.rb', line 16

def camelize
  self.to_s.camelize
end

#in?(ary) ⇒ Boolean

Returns TRUE if self is inside ary or has key self.

Parameters:

Returns:

  • (Boolean)

    TRUE if self is inside ary or has key self



5
6
7
8
9
10
11
12
13
14
# File 'lib/clir/Symbol.ext.rb', line 5

def in?(ary)
  case ary
  when Array
    ary.include?(self)
  when Hash
    ary.key?(self)
  else
    raise "Symbol#in? waits for a Array or an Hash. Given: #{ary.class}."
  end
end