Class: As2::Config::ServerInfo

Inherits:
Struct
  • Object
show all
Defined in:
lib/as2/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#certificateObject

Returns the value of attribute certificate

Returns:

  • (Object)

    the current value of certificate



68
69
70
# File 'lib/as2/config.rb', line 68

def certificate
  @certificate
end

#domainObject

Returns the value of attribute domain

Returns:

  • (Object)

    the current value of domain



68
69
70
# File 'lib/as2/config.rb', line 68

def domain
  @domain
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



68
69
70
# File 'lib/as2/config.rb', line 68

def name
  @name
end

#pkeyObject

Returns the value of attribute pkey

Returns:

  • (Object)

    the current value of pkey



68
69
70
# File 'lib/as2/config.rb', line 68

def pkey
  @pkey
end

#urlObject

Returns the value of attribute url

Returns:

  • (Object)

    the current value of url



68
69
70
# File 'lib/as2/config.rb', line 68

def url
  @url
end

Instance Method Details

#add_partner {|partner| ... } ⇒ Object

Yields:

  • (partner)


94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# File 'lib/as2/config.rb', line 94

def add_partner
  partner = Partner.new
  yield partner
  unless partner.name
    raise 'Partner name is required'
  end
  unless partner.signing_certificate
    raise 'Partner signing certificate is required'
  end
  unless partner.encryption_certificate
    raise 'Partner encryption certificate is required'
  end
  unless partner.url
    raise 'Partner URL is required'
  end
  Config.partners[partner.name] = partner
  Config.store.add_cert partner.signing_certificate
  Config.store.add_cert partner.encryption_certificate
end