Sha256: 28705a15600de1967b562b4ef6c8983d80aad613bdb6bf598981278281361a53

Contents?: true

Size: 398 Bytes

Versions: 54

Compression:

Stored size: 398 Bytes

Contents

class UITextField

  def sugarcube_to_s(options={})
    text = self.text
    if text && text.length > 20
      text = text[0..20] + '...'
    end
    placeholder = self.placeholder
    if placeholder && placeholder.length > 20
      placeholder = placeholder[0..20] + '...'
    end
    super options.merge(inner: {text: text, placeholder: placeholder, firstResponder?: firstResponder?})
  end

end

Version data entries

54 entries across 54 versions & 1 rubygems

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