Class: Sox::File

Inherits:
Object
  • Object
show all
Defined in:
lib/sox/file.rb

Overview

Represents input or output file with its options for the ‘sox` command.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path, options = {}) ⇒ File

Returns a new instance of File.

Parameters:

  • path (String)

    path to file

  • options (Hash{Symbol => Symbol,String,Numeric}) (defaults to: {})

    file options



16
17
18
19
20
# File 'lib/sox/file.rb', line 16

def initialize(path, options = {})
  @path    = path
  @options = options
  @escaped = false
end

Instance Attribute Details

#escapedObject

True if path doesn’t need to be escaped.



11
12
13
# File 'lib/sox/file.rb', line 11

def escaped
  @escaped
end

#optionsObject (readonly)

File options which will be placed right before it.



8
9
10
# File 'lib/sox/file.rb', line 8

def options
  @options
end

#pathObject (readonly)

Path to file or whatever.



5
6
7
# File 'lib/sox/file.rb', line 5

def path
  @path
end

Instance Method Details

#escaped?Boolean

Does the path need to be escaped?

Returns:

  • (Boolean)


25
26
27
# File 'lib/sox/file.rb', line 25

def escaped?
  @escaped
end