Sha256: 6bc59fd300a453509573fbef585c860272cb027e3b455367a5073bd019b11454

Contents?: true

Size: 655 Bytes

Versions: 66

Compression:

Stored size: 655 Bytes

Contents

module CF
  attach_variable 'kCFBooleanTrue', :pointer
  attach_variable 'kCFBooleanFalse', :pointer
  attach_function 'CFBooleanGetValue', [:pointer], :uchar

  # Wrapper for CFBooleanRef.
  # Typically you use the CF::Boolean::TRUE and CF::Boolean::FALSE constants
  #
  class Boolean < Base
    register_type("CFBoolean")
    # A constant containing kCFBooleanTrue
    TRUE = new(CF.kCFBooleanTrue)
    # A constant containing kCFBooleanFalse
    FALSE = new(CF.kCFBooleanFalse)

    # returns a ruby true/false value
    #
    # @return [Boolean]
    def value
      CF.CFBooleanGetValue(self) != 0
    end

    alias_method :to_ruby, :value
  end
end

Version data entries

66 entries across 23 versions & 3 rubygems

Version Path
og-corefoundation-0.2.3 lib/corefoundation/boolean.rb
og-corefoundation-0.2.2 lib/corefoundation/boolean.rb
og-corefoundation-0.2.1 lib/corefoundation/boolean.rb
corefoundation-0.3.13 lib/corefoundation/boolean.rb
corefoundation-0.3.10 lib/corefoundation/boolean.rb
corefoundation-0.3.4 lib/corefoundation/boolean.rb
yakg-0.1.11 vendor/gems/ruby/2.2.0/gems/corefoundation-0.2.0/lib/corefoundation/boolean.rb
yakg-0.1.11 vendor/gems/ruby/1.8/gems/corefoundation-0.2.0/lib/corefoundation/boolean.rb
yakg-0.1.11 vendor/gems/ruby/2.0.0/gems/corefoundation-0.2.0/lib/corefoundation/boolean.rb
yakg-0.1.11 vendor/gems/ruby/2.1.0/gems/corefoundation-0.2.0/lib/corefoundation/boolean.rb
yakg-0.1.11 vendor/gems/ruby/1.9.1/gems/corefoundation-0.2.0/lib/corefoundation/boolean.rb
yakg-0.1.10 vendor/gems/ruby/1.8/gems/corefoundation-0.2.0/lib/corefoundation/boolean.rb
yakg-0.1.10 vendor/gems/ruby/2.1.0/gems/corefoundation-0.2.0/lib/corefoundation/boolean.rb
yakg-0.1.10 vendor/gems/ruby/1.9.1/gems/corefoundation-0.2.0/lib/corefoundation/boolean.rb
yakg-0.1.10 vendor/gems/ruby/2.0.0/gems/corefoundation-0.2.0/lib/corefoundation/boolean.rb
yakg-0.1.10 vendor/gems/ruby/2.2.0/gems/corefoundation-0.2.0/lib/corefoundation/boolean.rb
yakg-0.1.9 vendor/gems/ruby/1.8/gems/corefoundation-0.2.0/lib/corefoundation/boolean.rb
yakg-0.1.9 vendor/gems/ruby/2.2.0/gems/corefoundation-0.2.0/lib/corefoundation/boolean.rb
yakg-0.1.9 vendor/gems/ruby/1.9.1/gems/corefoundation-0.2.0/lib/corefoundation/boolean.rb
yakg-0.1.9 vendor/gems/ruby/2.0.0/gems/corefoundation-0.2.0/lib/corefoundation/boolean.rb