Class: Eet::Client
- Inherits:
-
Object
- Object
- Eet::Client
- Defined in:
- lib/eet/client.rb
Instance Attribute Summary collapse
-
#certificate ⇒ Object
readonly
Returns the value of attribute certificate.
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Instance Method Summary collapse
-
#initialize(certificate, data) ⇒ Client
constructor
A new instance of Client.
- #submit(environment) ⇒ Object
Constructor Details
#initialize(certificate, data) ⇒ Client
Returns a new instance of Client.
5 6 7 8 |
# File 'lib/eet/client.rb', line 5 def initialize(certificate, data) @certificate = certificate @data = data end |
Instance Attribute Details
#certificate ⇒ Object (readonly)
Returns the value of attribute certificate.
3 4 5 |
# File 'lib/eet/client.rb', line 3 def certificate @certificate end |
#data ⇒ Object (readonly)
Returns the value of attribute data.
3 4 5 |
# File 'lib/eet/client.rb', line 3 def data @data end |
Instance Method Details
#submit(environment) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/eet/client.rb', line 10 def submit(environment) = Eet::Message.new(data) .pkp = Eet::Utils.create_pkp(, certificate) .bkp = Eet::Utils.create_bkp(.pkp) = Eet::Utils.sign(.to_xml, certificate) sender = Eet::Sender.new if environment == :playground sender.send_to_playground() elsif environment == :production sender.send_to_production() else raise Eet::UnknownEnvironmentError, "Unknown EET environment: #{environment}" end end |