Module: Mcrain::ClientProvider
- Included in:
- Base
- Defined in:
- lib/mcrain/client_provider.rb
Instance Method Summary collapse
- #build_client ⇒ Object
- #client ⇒ Object
- #client_class ⇒ Object
- #client_init_args ⇒ Object
- #client_require ⇒ Object
- #client_script ⇒ Object
Instance Method Details
#build_client ⇒ Object
8 9 10 11 12 |
# File 'lib/mcrain/client_provider.rb', line 8 def build_client require client_require yield if block_given? client_class.new(*client_init_args) end |
#client ⇒ Object
4 5 6 |
# File 'lib/mcrain/client_provider.rb', line 4 def client @client ||= build_client end |
#client_class ⇒ Object
18 19 20 |
# File 'lib/mcrain/client_provider.rb', line 18 def client_class raise NotImplementedError end |
#client_init_args ⇒ Object
22 23 24 |
# File 'lib/mcrain/client_provider.rb', line 22 def client_init_args raise NotImplementedError end |
#client_require ⇒ Object
14 15 16 |
# File 'lib/mcrain/client_provider.rb', line 14 def client_require raise NotImplementedError end |
#client_script ⇒ Object
26 27 28 29 |
# File 'lib/mcrain/client_provider.rb', line 26 def client_script client "#{client_class.name}.new(*#{client_init_args.inspect})" end |