app/controllers/epp/base_controller.rb
# Returns how many elements were present in the request
# if use_prefix is true, @prefix will be prepended to selectors e.g create > create > name
# default is true
#
# @prefix = 'create > create >'
# element_count 'name', 'registrar', use_prefix: false
# => 2
Returns how many elements were present in the request
if use_prefix is true, @prefix will be prepended to selectors e.g create > create > name
default is true
Returns how many elements were present in the request if use_prefix is true @prefix will be prepended to selectors e . g create > create > name default is true
def element_count(*selectors)
      options = selectors.extract_options!
      use_prefix = options[:use_prefix] != false 
      present_count = 0
      selectors.each do |selector|
        full_selector = use_prefix ? [@prefix, selector].compact.join(' ') : selector
        el = params[:parsed_frame].css(full_selector).first
        present_count += 1 if el && el.text.present?
      end
      present_count
    end
def element_count ( * selectors ) options = selectors . extract_options! use_prefix = options [ :use_prefix ] != false present_count = 0 selectors . each do | selector | full_selector = use_prefix ? [ @prefix , selector ] . compact . join ( ' ' ) : selector el = params [ :parsed_frame ] . css ( full_selector ) . first present_count += 1 if el && el . text . present? end present_count end
Returns how many elements were present in the request
if use_prefix is true, @prefix will be prepended to selectors e.g create > create > name
default is true
Returns how many elements were present in the request if use_prefix is true @prefix will be prepended to selectors e . g create > create > name default is true
# use_prefix is true by default
selectors
<not_specific>
prefix
'create > create >' element_count 'name', 'registrar', use_prefix: false => 2
' create > create > ' element_count ' name ' ' registrar ' use_prefix : false = > 2