Sha256: d90e83fdb7da7cfff94d3d3c2c6cb67c5c00f459c5fce750fe9ab6f5b9349f0d

Contents?: true

Size: 900 Bytes

Versions: 54

Compression:

Stored size: 900 Bytes

Contents

class NSView

  def sugarcube_to_s(options={})
    if self.respond_to? :stylename and self.stylename
      suffix = ' stylename: ' + self.stylename.inspect
    else
      suffix = ''
    end
    if options[:inner].is_a? Hash
      inner = ''
      options[:inner].each do |key, value|
        inner += ', ' if inner.length > 0
        inner += "#{key}: #{value.inspect}"
      end
    else
      inner = options[:inner]
    end

    "#{self.class.to_s}(##{self.object_id.to_s(16)}, [[#{frame.origin.x}, #{frame.origin.y}], [#{frame.size.width}, #{frame.size.height}]]" +
                        (inner ? ', ' + inner : '') +
                        ')' +
                        (options.fetch(:superview, true) && self.superview ? ", child of #{self.superview.class.to_s}(##{self.superview.object_id.to_s(16)})" : '') +
                        suffix
  end

  def to_s
    sugarcube_to_s
  end

end

Version data entries

54 entries across 54 versions & 1 rubygems

Version Path
sugarcube-4.0.0 lib/osx/sugarcube-to_s/nsview.rb
sugarcube-3.5.0 lib/osx/sugarcube-to_s/nsview.rb
sugarcube-3.4.2 lib/osx/sugarcube-to_s/nsview.rb
sugarcube-3.4.1 lib/osx/sugarcube-to_s/nsview.rb
sugarcube-3.4.0 lib/osx/sugarcube-to_s/nsview.rb
sugarcube-3.3.7 lib/osx/sugarcube-to_s/nsview.rb
sugarcube-3.3.6 lib/osx/sugarcube-to_s/nsview.rb
sugarcube-3.3.5 lib/osx/sugarcube-to_s/nsview.rb
sugarcube-3.3.4 lib/osx/sugarcube-to_s/nsview.rb
sugarcube-3.3.3 lib/osx/sugarcube-to_s/nsview.rb
sugarcube-3.3.2 lib/osx/sugarcube-to_s/nsview.rb
sugarcube-3.3.1 lib/osx/sugarcube-to_s/nsview.rb
sugarcube-3.3.0 lib/osx/sugarcube-to_s/nsview.rb
sugarcube-3.2.0 lib/osx/sugarcube-to_s/nsview.rb
sugarcube-3.1.1 lib/osx/sugarcube-to_s/nsview.rb
sugarcube-3.1.0 lib/osx/sugarcube-to_s/nsview.rb
sugarcube-3.0.8 lib/osx/sugarcube-to_s/nsview.rb
sugarcube-3.0.7 lib/osx/sugarcube-to_s/nsview.rb
sugarcube-3.0.6 lib/osx/sugarcube-to_s/nsview.rb
sugarcube-3.0.5 lib/osx/sugarcube-to_s/nsview.rb