Class: InternetBS::DotNLAttributes

Inherits:
AdditionalAttributes show all
Defined in:
lib/internetbs/dot_nl_attributes.rb

Constant Summary collapse

{
  'BGG'         => 'Non-Dutch EC company',
  'BRO'         => 'Non-Dutch legal form/enterprise/subsidiary',
  'BV'          => 'Limited company',
  'BVI/O'       => 'Limited company in formation',
  'COOP'        => 'Cooperative',
  'CV'          => 'Limited Partnership',
  'EENMANSZAAK' => 'Sole trader',
  'EESV'        => 'European Economic Interest Group',
  'KERK'        => 'Religious society',
  'MAATSCHAP'   => 'Partnership',
  'NV'          => 'Public Company',
  'OWM'         => 'Mutual benefit company',
  'PERSOON'     => 'Natural person',
  'REDR'        => 'Shipping company',
  'STICHTING'   => 'Foundation',
  'VERENIGING'  => 'Association',
  'VOF Trading' => 'partnership',
  'ANDERS'      => 'Other'
}

Instance Method Summary collapse

Methods inherited from AdditionalAttributes

#admin_params, #billing_params, #mandatory_params, #optional_params, #zone_params

Methods inherited from Base

#inspect

Instance Method Details

#registrant_paramsObject



29
30
31
32
33
34
35
36
37
# File 'lib/internetbs/dot_nl_attributes.rb', line 29

def registrant_params
  params = {
    'registrant_nllegalform' => @legal_form,
    'registrant_nlterm'      => @terms_accepted ? 'YES' : 'NO',
    'registrant_clientip'    => @ip_address
  }
  params.merge!({'registrant_nlregnumber' => @registration_number}) if @registration_number
  return params
end

#valid?(inputs = {}) ⇒ Boolean

Returns:

  • (Boolean)


39
40
41
42
43
44
45
# File 'lib/internetbs/dot_nl_attributes.rb', line 39

def valid?(inputs = {})
  ensure_attribute_has_value :ip_address, :legal_form, :terms_accepted
  unless LEGAL_FORMS.include?(@legal_form)
    @errors << "legal_form must be one in LEGAL_FORMS"
  end
  super
end