Class: Object

Inherits:
BasicObject
Defined in:
lib/all/sugarcube-legacy/activesupport.rb,
lib/cocoa/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) ⇒ 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
# File 'lib/all/sugarcube-legacy/activesupport.rb', line 19

def __in_workaround(args)
  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/all/sugarcube-legacy/activesupport.rb', line 8

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

#present?Boolean

Returns:

  • (Boolean)


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

def present?
  !blank?
end

#to_nsuserdefaultsObject



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

def to_nsuserdefaults
  self
end