Class: NSURL

Inherits:
Object show all
Defined in:
lib/cocoa/sugarcube-to_s/nsurl.rb,
lib/cocoa/sugarcube-nsdata/nsurl.rb,
lib/cocoa/sugarcube-foundation/nsurl.rb

Instance Method Summary collapse

Instance Method Details

#can_open?Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/cocoa/sugarcube-foundation/nsurl.rb', line 7

def can_open?
  UIApplication.sharedApplication.canOpenURL(self)
end

#inspectObject



7
8
9
10
11
# File 'lib/cocoa/sugarcube-to_s/nsurl.rb', line 7

def inspect
  "#<#{self.class.to_s}:0x#{self.object_id.to_s(16)}, "+
    "URL=#{self.absoluteString.inspect}"+
   ">"
end

#nsdataObject



3
4
5
# File 'lib/cocoa/sugarcube-nsdata/nsurl.rb', line 3

def nsdata
  NSData.dataWithContentsOfURL(self)
end

#nsmutableurlrequestObject



19
20
21
# File 'lib/cocoa/sugarcube-foundation/nsurl.rb', line 19

def nsmutableurlrequest
  NSMutableURLRequest.alloc.initWithURL(self)
end

#nsurlObject



11
12
13
# File 'lib/cocoa/sugarcube-foundation/nsurl.rb', line 11

def nsurl
  self
end

#nsurlrequestObject



15
16
17
# File 'lib/cocoa/sugarcube-foundation/nsurl.rb', line 15

def nsurlrequest
  NSURLRequest.requestWithURL(self)
end

#openObject



3
4
5
# File 'lib/cocoa/sugarcube-foundation/nsurl.rb', line 3

def open
  UIApplication.sharedApplication.openURL(self)
end

#to_sObject



3
4
5
# File 'lib/cocoa/sugarcube-to_s/nsurl.rb', line 3

def to_s
  self.absoluteString
end