Class: RubyMotionQuery::AlertField
- Inherits:
-
Object
- Object
- RubyMotionQuery::AlertField
- Defined in:
- lib/project/alert_field.rb
Instance Attribute Summary collapse
-
#keyboard_type ⇒ Object
Returns the value of attribute keyboard_type.
-
#name ⇒ Object
Returns the value of attribute name.
-
#placeholder ⇒ Object
Returns the value of attribute placeholder.
-
#secure_text_entry ⇒ Object
Returns the value of attribute secure_text_entry.
Instance Method Summary collapse
-
#initialize(name, opts = {}) ⇒ AlertField
constructor
A new instance of AlertField.
Constructor Details
#initialize(name, opts = {}) ⇒ AlertField
Returns a new instance of AlertField.
9 10 11 12 13 14 15 16 |
# File 'lib/project/alert_field.rb', line 9 def initialize(name, opts = {}) raise ArgumentError.new "A name parameter must be provided" unless name && name.length > 0 opts = {placeholder: opts, keyboard_type: :default} if opts.is_a? String @name = name.is_a?(Symbol) ? name : name.strip.gsub(/\s+/,'_').to_sym @keyboard_type = RubyMotionQuery::Stylers::KEYBOARD_TYPES.has_key?(opts[:keyboard_type]) ? opts[:keyboard_type] : :default @placeholder = opts[:placeholder] || '' @secure_text_entry = opts[:secure_text_entry] || false end |
Instance Attribute Details
#keyboard_type ⇒ Object
Returns the value of attribute keyboard_type.
4 5 6 |
# File 'lib/project/alert_field.rb', line 4 def keyboard_type @keyboard_type end |
#name ⇒ Object
Returns the value of attribute name.
7 8 9 |
# File 'lib/project/alert_field.rb', line 7 def name @name end |
#placeholder ⇒ Object
Returns the value of attribute placeholder.
5 6 7 |
# File 'lib/project/alert_field.rb', line 5 def placeholder @placeholder end |
#secure_text_entry ⇒ Object
Returns the value of attribute secure_text_entry.
6 7 8 |
# File 'lib/project/alert_field.rb', line 6 def secure_text_entry @secure_text_entry end |