Class: XmlSig::RetrievalMethod

Inherits:
Object
  • Object
show all
Defined in:
lib/xml_sig/key_info.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#typeObject

Returns the value of attribute type.



21
22
23
# File 'lib/xml_sig/key_info.rb', line 21

def type
  @type
end

#uriObject

Returns the value of attribute uri.



20
21
22
# File 'lib/xml_sig/key_info.rb', line 20

def uri
  @uri
end

Instance Method Details

#to_xml(xml = Builder::XmlMarkup.new) ⇒ Object



31
32
33
34
35
36
37
# File 'lib/xml_sig/key_info.rb', line 31

def to_xml(xml=Builder::XmlMarkup.new)
  attributes = {'URI' => uri}
  attributes['Type'] = type unless type.nil?
  xml.tag!('ds:RetrievalMethod', attributes) {
    transforms.each { |transform| xml << transform.to_xml }
  }
end

#transformsObject



23
24
25
# File 'lib/xml_sig/key_info.rb', line 23

def transforms
  @transforms ||= []
end

#validateObject

Raises:

  • (ValidationError)


27
28
29
# File 'lib/xml_sig/key_info.rb', line 27

def validate
  raise ValidationError, "URI is required" if uri.nil?
end