Class: Lanmao::Client
- Inherits:
-
Object
- Object
- Lanmao::Client
- Defined in:
- lib/lanmao/client.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
Returns the value of attribute config.
Instance Method Summary collapse
-
#initialize(options_arg) ⇒ Client
constructor
A new instance of Client.
- #verify_data?(data) ⇒ Boolean
Constructor Details
#initialize(options_arg) ⇒ Client
Returns a new instance of Client.
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/lanmao/client.rb', line 25 def initialize() = Utils.symbolize_keys() @config = { path: [:path], platform_no: [:platform_no], key_serial: [:key_serial], private_key: OpenSSL::PKey::RSA.new([:private_key]), public_key: OpenSSL::PKey::RSA.new([:public_key]), } # 自动 include api 下的模块 recursive_include_api('Lanmao::Api') # 自动 include form 下的模块 recursive_include_api('Lanmao::Form') end |
Instance Attribute Details
#config ⇒ Object
Returns the value of attribute config.
7 8 9 |
# File 'lib/lanmao/client.rb', line 7 def config @config end |
Instance Method Details
#verify_data?(data) ⇒ Boolean
42 43 44 |
# File 'lib/lanmao/client.rb', line 42 def verify_data?(data) Sign.verify(data, @config) end |