Class: NSSize

Inherits:
Object
  • Object
show all
Includes:
PurplishFrame::CanScaleWidthHeight
Defined in:
lib/purplish-frame/non-ui/osx/ns_size.rb,
lib/purplish-frame/non-ui/osx/ns_array.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from PurplishFrame::CanScaleWidthHeight

#scale_to_fill, #scale_to_fill!, #scale_to_fit, #scale_to_fit!

Class Method Details

.to_native_size(anObject) ⇒ Object



4
5
6
# File 'lib/purplish-frame/non-ui/osx/ns_size.rb', line 4

def self.to_native_size(anObject)
  anObject.to_size
end

Instance Method Details

#square?Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/purplish-frame/non-ui/osx/ns_size.rb', line 8

def square?
  width == height && width > 0
end

#to_sizeObject



8
9
10
# File 'lib/purplish-frame/non-ui/osx/ns_array.rb', line 8

def to_size
  self
end