Class: ProcessSip::Adapter
- Inherits:
-
Object
- Object
- ProcessSip::Adapter
- Defined in:
- lib/process_sip.rb
Instance Method Summary collapse
- #call(name, &block) ⇒ Object
-
#initialize(name) ⇒ Adapter
constructor
A new instance of Adapter.
- #omit(*keys) ⇒ Object
- #preprint ⇒ Object
- #silent ⇒ Object
- #with(**options) ⇒ Object
Constructor Details
Instance Method Details
#call(name, &block) ⇒ Object
34 35 36 37 38 39 |
# File 'lib/process_sip.rb', line 34 def call(name, *, **, &block) chain = [@name, @context.arguments, name.to_s.dasherize, process(*, **)].flatten.map(&:shellescape).join(" ") puts chain if @preprint IO.popen(chain, &block || -> { _1.read.chomp }) end |
#omit(*keys) ⇒ Object
31 |
# File 'lib/process_sip.rb', line 31 def omit(*keys) = clone_with(context: @context.except(*keys)) |
#preprint ⇒ Object
51 |
# File 'lib/process_sip.rb', line 51 def preprint = clone_with(preprint: true) |
#silent ⇒ Object
52 |
# File 'lib/process_sip.rb', line 52 def silent = clone_with(preprint: false) |
#with(**options) ⇒ Object
32 |
# File 'lib/process_sip.rb', line 32 def with(**) = clone_with(context: @context.merge(**)) |