Class: IntegerCommaInput

Inherits:
React::Component::Base
  • Object
show all
Includes:
AbstractNumeric
Defined in:
lib/bull/ui_core.rb

Instance Method Summary collapse

Methods included from AbstractNumeric

#render

Methods included from ClassesInput

#dirty_class, #valid_class

Instance Method Details

#format(value) ⇒ Object



294
295
296
# File 'lib/bull/ui_core.rb', line 294

def format value
  format_integer value
end

#parse(val) ⇒ Object



298
299
300
301
302
303
304
# File 'lib/bull/ui_core.rb', line 298

def parse val
  begin
    Integer(val.gsub(',', ''))
  rescue
    nil
  end
end

#update_state(event) ⇒ Object



306
307
308
# File 'lib/bull/ui_core.rb', line 306

def update_state event
  params.on_change parse(event.target.value)
end