Sha256: 9957aca79391bf7850911ce2b8f3200ea0056b800687001062185d608299737b

Contents?: true

Size: 1.23 KB

Versions: 42

Compression:

Stored size: 1.23 KB

Contents

class UIView

  def sugarcube_to_s(options={})
    suffix = ''
    # teacup
    if self.respond_to?(:stylename) && self.stylename && self.stylename.length > 0
      suffix += " stylename: #{self.stylename.inspect}"
    end
    # motionkit
    if self.respond_to?(:motion_kit_ids) && self.motion_kit_ids && self.motion_kit_ids.length > 0
      if motion_kit_ids.length == 1
        suffix += " motion_kit_id: #{self.motion_kit_id.inspect}"
      else
        suffix += " motion_kit_ids: #{self.motion_kit_ids.inspect}"
      end
    end
    # rmq?

    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

42 entries across 42 versions & 1 rubygems

Version Path
sugarcube-3.0.4 lib/ios/sugarcube-to_s/uiview.rb
sugarcube-3.0.3 lib/ios/sugarcube-to_s/uiview.rb
sugarcube-3.0.2 lib/ios/sugarcube-to_s/uiview.rb
sugarcube-3.0.1 lib/ios/sugarcube-to_s/uiview.rb
sugarcube-3.0.0 lib/ios/sugarcube-to_s/uiview.rb
sugarcube-2.12.3 lib/ios/sugarcube-to_s/uiview.rb
sugarcube-2.12.2 lib/ios/sugarcube-to_s/uiview.rb
sugarcube-2.12.1 lib/ios/sugarcube-to_s/uiview.rb
sugarcube-2.12.0 lib/ios/sugarcube-to_s/uiview.rb
sugarcube-2.11.1 lib/ios/sugarcube-to_s/uiview.rb
sugarcube-2.11.0 lib/ios/sugarcube-to_s/uiview.rb
sugarcube-2.10.0 lib/ios/sugarcube-to_s/uiview.rb
sugarcube-2.9.1 lib/ios/sugarcube-to_s/uiview.rb
sugarcube-2.8.2 lib/ios/sugarcube-to_s/uiview.rb
sugarcube-2.8.1 lib/ios/sugarcube-to_s/uiview.rb
sugarcube-2.8.0 lib/ios/sugarcube-to_s/uiview.rb
sugarcube-2.7.1 lib/ios/sugarcube-to_s/uiview.rb
sugarcube-2.7.0 lib/ios/sugarcube-to_s/uiview.rb
sugarcube-2.6.0 lib/ios/sugarcube-to_s/uiview.rb
sugarcube-2.5.0 lib/ios/sugarcube-to_s/uiview.rb