Sha256: 399b990e9f1bc9dbad65103bedf416861055952ae39af005a6e6ae3893b15cc4

Contents?: true

Size: 997 Bytes

Versions: 7

Compression:

Stored size: 997 Bytes

Contents

class UIView

  def sugarcube_to_s(options={})
    suffix = ''
    suffix += " stylename: #{self.stylename.inspect}" if self.respond_to?(:stylename) && self.stylename
    suffix += " motion_kit_id: #{self.motion_kit_id.inspect}" if self.respond_to?(:motion_kit_id) && self.motion_kit_id

    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

7 entries across 7 versions & 1 rubygems

Version Path
sugarcube-2.4.0 lib/ios/sugarcube-to_s/uiview.rb
sugarcube-2.3.0 lib/ios/sugarcube-to_s/uiview.rb
sugarcube-2.2.0 lib/ios/sugarcube-to_s/uiview.rb
sugarcube-2.1.5 lib/ios/sugarcube-to_s/uiview.rb
sugarcube-2.1.4 lib/ios/sugarcube-to_s/uiview.rb
sugarcube-2.1.3 lib/ios/sugarcube-to_s/uiview.rb
sugarcube-2.1.2 lib/ios/sugarcube-to_s/uiview.rb