Class: Object

Inherits:
BasicObject
Defined in:
lib/sugarcube-legacy/activesupport.rb,
lib/sugarcube-nsuserdefaults/nsuserdefaults.rb

Overview

Thanks ruby on rails!

These are all blatent, unapologetic rip offs of RoR extensions, and they behave in exactly the same way.

Instance Method Summary collapse

Instance Method Details

#__in_workaround(args, *other_args) ⇒ Object Also known as: in?

okay, this is strange, but rake spec fails if I define the method as in? but passes if I alias it, as I do below. weird, but I don't want to fight it.



19
20
21
22
23
24
25
26
# File 'lib/sugarcube-legacy/activesupport.rb', line 19

def __in_workaround(args, *other_args)
  if other_args.length > 0
    raise "The varargs form of `Object#in?` has been removed.  Use an array instead."
  end
  args.include?(self)
rescue NoMethodError
  raise ArgumentError.new("The parameter passed to #in? must respond to #include?")
end

#blank?Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/sugarcube-legacy/activesupport.rb', line 8

def blank?
  respond_to?(:empty?) ? empty? : !self
end

#present?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/sugarcube-legacy/activesupport.rb', line 12

def present?
  !blank?
end

#to_nsuserdefaultsObject



29
30
31
# File 'lib/sugarcube-nsuserdefaults/nsuserdefaults.rb', line 29

def to_nsuserdefaults
  self
end