Class: Cocoa::CFRange

Inherits:
FFI::Struct
  • Object
show all
Defined in:
lib/cocoa/structs/NSRange.rb

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ CFRange

Returns a new instance of CFRange.



3
4
5
6
7
8
9
10
11
# File 'lib/cocoa/structs/NSRange.rb', line 3

def initialize *args
  options = args.first
  if options.is_a? Hash
    self[:location] = options[:location]
    self[:length]   = options[:length]
  else
    super *args
  end
end

Instance Method Details

#to_sObject



12
13
14
# File 'lib/cocoa/structs/NSRange.rb', line 12

def to_s
  "<CFRange: #{self[:location]} #{self[:length]}>"
end