Sha256: 6cf166161c63d7f9c8db08e57acef630fe8908248e4b456ed9e4e077eea13795

Contents?: true

Size: 633 Bytes

Versions: 12

Compression:

Stored size: 633 Bytes

Contents

class NSArray
  def to_rect
    if PurplishFrame.ios?
      CGRect.new([self[0][0], self[0][1]], [self[1][0], self[1][1]])
    else
      NSRect.new([self[0][0], self[0][1]], [self[1][0], self[1][1]])
    end
  end

  def to_size
    if PurplishFrame.ios?
      CGSize.new(self[0], self[1])
    else
      NSSize.new(self[0], self[1])
    end
  end

  def to_point
    if PurplishFrame.ios?
      CGPoint.new(self[0], self[1])
    else
      NSPoint.new(self[0], self[1])
    end
  end
end

class CGRect
  def to_rect
    self
  end
end

class CGSize
  def to_size
    self
  end
end

class CGPoint
  def to_point
    self
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
purplish-frame-0.0.12 lib/purplish-frame/non-ui/ns_array.rb
purplish-frame-0.0.11 lib/purplish-frame/non-ui/ns_array.rb
purplish-frame-0.0.10 lib/purplish-frame/non-ui/ns_array.rb
purplish-frame-0.0.9 lib/purplish-frame/non-ui/ns_array.rb
purplish-frame-0.0.8 lib/purplish-frame/non-ui/ns_array.rb
purplish-frame-0.0.7 lib/purplish-frame/non-ui/ns_array.rb
purplish-frame-0.0.6 lib/purplish-frame/non-ui/ns_array.rb
purplish-frame-0.0.5 lib/purplish-frame/non-ui/ns_array.rb
purplish-frame-0.0.4 lib/purplish-frame/non-ui/ns_array.rb
purplish-frame-0.0.3 lib/purplish-frame/non-ui/ns_array.rb
purplish-frame-0.0.2 lib/purplish-frame/ns_array.rb
purplish-frame-0.0.1 lib/purplish-frame/ns_array.rb