Class: OsCtld::Config::Mbuffer

Inherits:
Object
  • Object
show all
Defined in:
lib/osctld/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cfg) ⇒ Mbuffer

Returns a new instance of Mbuffer.



89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# File 'lib/osctld/config.rb', line 89

def initialize(cfg)
  @block_size = cfg.fetch('block_size', '128k')
  @buffer_size = cfg.fetch('buffer_size', '256M')
  @start_writing_at = cfg.fetch('start_writing_at', 80)
  @as_cli_options = [
    '-s', block_size,
    '-m', buffer_size,
    '-P', start_writing_at.to_s
  ]
  @as_hash_options = {
    block_size:,
    buffer_size:,
    start_writing_at:
  }
end

Instance Attribute Details

#as_cli_optionsArray<String> (readonly)

Returns:

  • (Array<String>)


84
85
86
# File 'lib/osctld/config.rb', line 84

def as_cli_options
  @as_cli_options
end

#as_hash_optionsHash (readonly)

Returns:

  • (Hash)


87
88
89
# File 'lib/osctld/config.rb', line 87

def as_hash_options
  @as_hash_options
end

#block_sizeString (readonly)

Returns:

  • (String)


75
76
77
# File 'lib/osctld/config.rb', line 75

def block_size
  @block_size
end

#buffer_sizeString (readonly)

Returns:

  • (String)


78
79
80
# File 'lib/osctld/config.rb', line 78

def buffer_size
  @buffer_size
end

#start_writing_atInteger (readonly)

Returns:

  • (Integer)


81
82
83
# File 'lib/osctld/config.rb', line 81

def start_writing_at
  @start_writing_at
end