Class: JxClient
- Inherits:
-
Object
- Object
- JxClient
- Defined in:
- lib/jx_client.rb,
lib/jx_client/version.rb,
lib/jx_client/get_document.rb,
lib/jx_client/put_document.rb,
lib/jx_client/operation_base.rb,
lib/jx_client/confirm_document.rb,
lib/jx_client/get_document_result.rb
Overview
JX手順クライアント
Defined Under Namespace
Classes: ConfirmDocument, Error, GetDocument, GetDocumentResult, OperationBase, PutDocument
Constant Summary collapse
- DEFAULT_OPTIONS =
{ env_namespace: :soap, convert_request_keys_to: :none, }.freeze
- VERSION =
"0.1.1"
- GET_DOCUMENT_PROPERTIES =
[ :get_document_result, :message_id, :data, :sender_id, :receiver_id, :format_type, :document_type, ].freeze
Instance Attribute Summary collapse
-
#jx_default_confirm_document_options ⇒ Object
readonly
Returns the value of attribute jx_default_confirm_document_options.
-
#jx_default_get_document_options ⇒ Object
readonly
Returns the value of attribute jx_default_get_document_options.
-
#jx_default_options ⇒ Object
readonly
Returns the value of attribute jx_default_options.
-
#jx_default_put_document_options ⇒ Object
readonly
Returns the value of attribute jx_default_put_document_options.
-
#jx_message_id_generate ⇒ Object
readonly
Returns the value of attribute jx_message_id_generate.
-
#jx_timestamp_generate ⇒ Object
readonly
Returns the value of attribute jx_timestamp_generate.
-
#jx_version ⇒ Object
readonly
Returns the value of attribute jx_version.
Class Method Summary collapse
-
.wsdl(version:) ⇒ Object
WSDL content.
-
.wsdl_path(version:) ⇒ Object
WSDL file path.
Instance Method Summary collapse
- #client ⇒ Savon::Client
-
#client_options ⇒ Hash
Savon.clientのオプション.
- #confirm_document {|operation| ... } ⇒ JxClient::ConfirmDocument
- #get_document {|operation| ... } ⇒ JxClient::GetDocument
-
#initialize(options = {}) {|client| ... } ⇒ JxClient
constructor
A new instance of JxClient.
- #put_document {|operation| ... } ⇒ JxClient::PutDocument
-
#wsdl ⇒ String
WSDL content.
Constructor Details
#initialize(options = {}) {|client| ... } ⇒ JxClient
Returns a new instance of JxClient.
51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/jx_client.rb', line 51 def initialize( = {}, &block) @savon_client_options = DEFAULT_OPTIONS.merge() @jx_version = @savon_client_options.delete(:jx_version) || 2007 @jx_message_id_generate = @savon_client_options.delete(:jx_message_id_generate) @jx_timestamp_generate = @savon_client_options.delete(:jx_timestamp_generate) @jx_default_options = @savon_client_options.delete(:jx_default_options) || {} @jx_default_put_document_options = @savon_client_options.delete(:jx_default_put_document_options) || {} @jx_default_get_document_options = @savon_client_options.delete(:jx_default_get_document_options) || {} @jx_default_confirm_document_options = @savon_client_options.delete(:jx_default_confirm_document_options) || {} @savon_client_block = block end |
Instance Attribute Details
#jx_default_confirm_document_options ⇒ Object (readonly)
Returns the value of attribute jx_default_confirm_document_options.
34 35 36 |
# File 'lib/jx_client.rb', line 34 def @jx_default_confirm_document_options end |
#jx_default_get_document_options ⇒ Object (readonly)
Returns the value of attribute jx_default_get_document_options.
34 35 36 |
# File 'lib/jx_client.rb', line 34 def @jx_default_get_document_options end |
#jx_default_options ⇒ Object (readonly)
Returns the value of attribute jx_default_options.
34 35 36 |
# File 'lib/jx_client.rb', line 34 def @jx_default_options end |
#jx_default_put_document_options ⇒ Object (readonly)
Returns the value of attribute jx_default_put_document_options.
34 35 36 |
# File 'lib/jx_client.rb', line 34 def @jx_default_put_document_options end |
#jx_message_id_generate ⇒ Object (readonly)
Returns the value of attribute jx_message_id_generate.
34 35 36 |
# File 'lib/jx_client.rb', line 34 def @jx_message_id_generate end |
#jx_timestamp_generate ⇒ Object (readonly)
Returns the value of attribute jx_timestamp_generate.
34 35 36 |
# File 'lib/jx_client.rb', line 34 def @jx_timestamp_generate end |
#jx_version ⇒ Object (readonly)
Returns the value of attribute jx_version.
34 35 36 |
# File 'lib/jx_client.rb', line 34 def jx_version @jx_version end |
Class Method Details
.wsdl(version:) ⇒ Object
WSDL content
22 23 24 25 |
# File 'lib/jx_client.rb', line 22 def wsdl(version:) @wsdl ||= {} @wsdl[version] ||= File.read(wsdl_path(version: version)) end |
.wsdl_path(version:) ⇒ Object
WSDL file path
29 30 31 |
# File 'lib/jx_client.rb', line 29 def wsdl_path(version:) File.("../../wsdl/jx#{version}.wsdl.xml", __FILE__) end |
Instance Method Details
#client ⇒ Savon::Client
64 65 66 |
# File 'lib/jx_client.rb', line 64 def client @client ||= Savon.client(, &@savon_client_block) end |
#client_options ⇒ Hash
Returns Savon.clientのオプション.
69 70 71 72 73 74 75 |
# File 'lib/jx_client.rb', line 69 def if @jx_version @savon_client_options.merge(wsdl: wsdl) else @savon_client_options end end |
#confirm_document {|operation| ... } ⇒ JxClient::ConfirmDocument
104 105 106 107 108 |
# File 'lib/jx_client.rb', line 104 def confirm_document ConfirmDocument.from_jx_client(self).tap do |operation| yield operation if block_given? end end |
#get_document {|operation| ... } ⇒ JxClient::GetDocument
95 96 97 98 99 |
# File 'lib/jx_client.rb', line 95 def get_document # rubocop:disable Naming/AccessorMethodName GetDocument.from_jx_client(self).tap do |operation| yield operation if block_given? end end |
#put_document {|operation| ... } ⇒ JxClient::PutDocument
86 87 88 89 90 |
# File 'lib/jx_client.rb', line 86 def put_document PutDocument.from_jx_client(self).tap do |operation| yield operation if block_given? end end |