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.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/lanmao/client.rb', line 9 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
26 27 28 |
# File 'lib/lanmao/client.rb', line 26 def verify_data?(data) Sign.verify(data, @config) end |