Sha256: c95e199b9a845c47a60db435d4ad3c3c234f673faf71a01b9398360381c86d63

Contents?: true

Size: 814 Bytes

Versions: 34

Compression:

Stored size: 814 Bytes

Contents

class UIView

  def 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.name}(##{self.object_id.to_s(16)}, #{SugarCube::Adjust::format_frame(self.frame)}" +
                        (inner ? ', ' + inner : '') +
                        ')' +
                        (options.fetch(:superview, true) && self.superview ? ", child of #{self.superview.class.name}(##{self.superview.object_id.to_s(16)})" : '') +
                        suffix
  end

end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
sugarcube-1.7.0 lib/sugarcube-to_s/uiview.rb
sugarcube-1.6.3 lib/sugarcube-to_s/uiview.rb
sugarcube-1.6.2 lib/sugarcube-to_s/uiview.rb
sugarcube-1.6.1 lib/sugarcube-to_s/uiview.rb
sugarcube-1.6.0 lib/sugarcube-to_s/uiview.rb
sugarcube-1.5.9 lib/sugarcube-to_s/uiview.rb
sugarcube-1.5.8 lib/sugarcube-to_s/uiview.rb
sugarcube-1.5.7 lib/sugarcube-to_s/uiview.rb
sugarcube-1.5.6 lib/sugarcube-to_s/uiview.rb
sugarcube-1.5.5 lib/sugarcube-to_s/uiview.rb
sugarcube-1.5.4 lib/sugarcube-to_s/uiview.rb
sugarcube-1.5.3 lib/sugarcube-to_s/uiview.rb
sugarcube-1.5.2 lib/sugarcube-to_s/uiview.rb
sugarcube-1.5.1 lib/sugarcube-to_s/uiview.rb
sugarcube-1.5.0 lib/sugarcube-to_s/uiview.rb
sugarcube-1.4.6 lib/sugarcube-to_s/uiview.rb
sugarcube-1.4.5 lib/sugarcube-to_s/uiview.rb
sugarcube-1.4.4 lib/sugarcube-to_s/uiview.rb
sugarcube-1.4.3 lib/sugarcube-to_s/uiview.rb
sugarcube-1.4.2 lib/sugarcube-to_s/uiview.rb