Class: Lolcommits::Capturer

Inherits:
Object
  • Object
show all
Defined in:
lib/lolcommits/capturer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Capturer

Returns a new instance of Capturer.



8
9
10
11
12
# File 'lib/lolcommits/capturer.rb', line 8

def initialize(attributes = {})
  attributes.each do |attr, val|
    send("#{attr}=", val)
  end
end

Instance Attribute Details

#capture_delayObject

Returns the value of attribute capture_delay.



5
6
7
# File 'lib/lolcommits/capturer.rb', line 5

def capture_delay
  @capture_delay
end

#capture_deviceObject

Returns the value of attribute capture_device.



5
6
7
# File 'lib/lolcommits/capturer.rb', line 5

def capture_device
  @capture_device
end

#capture_durationObject

Returns the value of attribute capture_duration.



5
6
7
# File 'lib/lolcommits/capturer.rb', line 5

def capture_duration
  @capture_duration
end

#capture_pathObject

Returns the value of attribute capture_path.



5
6
7
# File 'lib/lolcommits/capturer.rb', line 5

def capture_path
  @capture_path
end

Instance Method Details

#debug(message) ⇒ Object



19
20
21
# File 'lib/lolcommits/capturer.rb', line 19

def debug(message)
  super("#{self.class}: #{message}")
end

#system_call(call_str, capture_output: false) ⇒ Object



14
15
16
17
# File 'lib/lolcommits/capturer.rb', line 14

def system_call(call_str, capture_output: false)
  debug "making system call for \n #{call_str}"
  capture_output ? `#{call_str}` : system(call_str)
end