Class: RVM::Functions::Capstr

Inherits:
Function
  • Object
show all
Defined in:
lib/rvm/functions/string/capstr.rb

Class Method Summary collapse

Methods inherited from Function

call, execargs, method_missing

Methods included from Plugin

#helper, #included, #plugin_host, #plugin_id, #register_for

Class Method Details

.data_typeObject



16
17
18
# File 'lib/rvm/functions/string/capstr.rb', line 16

def data_type
  :string
end

.execute(params, env) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/rvm/functions/string/capstr.rb', line 5

def execute params, env
  if (params.length == 1)
    RVM::Classes[:string].new(params.first.capitalize)
  else
    RVM::Classes[:error].new(1,"#-1 FUNCTION (#{self.class.to_s}) EXPECTS 1 ARGUMENT BUT GOT #{params.length}")            
  end
end

.signatureObject



13
14
15
# File 'lib/rvm/functions/string/capstr.rb', line 13

def signature
  [:string]
end