Sha256: f27c76306991529f3efb60ce14a5645c5b2e094e67b8787ee636693db9b8b6ad

Contents?: true

Size: 388 Bytes

Versions: 105

Compression:

Stored size: 388 Bytes

Contents

class UITextField

  def 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

105 entries across 105 versions & 1 rubygems

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