class String
Public Instance Methods
class_from()
click to toggle source
# File lib/dldinternet/thor/mixins/no_commands.rb, line 21 def class_from self.split('::').inject(Object) do |mod, class_name| mod.const_get(class_name) end end
Also aliased as: to_class
to_bool()
click to toggle source
# File lib/dldinternet/thor/mixins/no_commands.rb, line 14 def to_bool return true if self == true || !self.match(/^(true|t|yes|y|1|on)$/i).nil? return false if self == false || self.blank? || !self.match(/^(false|f|no|n|0|off)$/i).nil? raise ArgumentError.new("invalid value for Boolean: \"#{self}\"") end
Also aliased as: to_b