Class: CXML::Credential
- Inherits:
-
Object
- Object
- CXML::Credential
- Defined in:
- lib/cxml/credential.rb
Instance Attribute Summary collapse
-
#credential_mac ⇒ Object
Returns the value of attribute credential_mac.
-
#domain ⇒ Object
Returns the value of attribute domain.
-
#identity ⇒ Object
Returns the value of attribute identity.
-
#shared_secret ⇒ Object
Returns the value of attribute shared_secret.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(data = {}) ⇒ Credential
constructor
Initialize a new Credential instance.
- #render(node) ⇒ Object
Constructor Details
#initialize(data = {}) ⇒ Credential
Initialize a new Credential instance
45 46 47 48 49 50 51 52 |
# File 'lib/cxml/credential.rb', line 45 def initialize(data={}) if data.kind_of?(Hash) && !data.empty? @domain = data['domain'] @type = data['type'] @identity = data['Identity'] @shared_secret = data['SharedSecret'] end end |
Instance Attribute Details
#credential_mac ⇒ Object
Returns the value of attribute credential_mac.
40 41 42 |
# File 'lib/cxml/credential.rb', line 40 def credential_mac @credential_mac end |
#domain ⇒ Object
Returns the value of attribute domain.
37 38 39 |
# File 'lib/cxml/credential.rb', line 37 def domain @domain end |
#identity ⇒ Object
Returns the value of attribute identity.
41 42 43 |
# File 'lib/cxml/credential.rb', line 41 def identity @identity end |
#shared_secret ⇒ Object
Returns the value of attribute shared_secret.
39 40 41 |
# File 'lib/cxml/credential.rb', line 39 def shared_secret @shared_secret end |
#type ⇒ Object
Returns the value of attribute type.
38 39 40 |
# File 'lib/cxml/credential.rb', line 38 def type @type end |
Instance Method Details
#render(node) ⇒ Object
54 55 56 57 58 59 60 |
# File 'lib/cxml/credential.rb', line 54 def render(node) node.Credential('domain' => domain) do |c| c.Identity(@identity) c.SharedSecret(@shared_secret) if @shared_secret end node end |