Class: ProconBypassMan::Procon::ModeRegistry2::Mode

Inherits:
Object
  • Object
show all
Defined in:
lib/procon_bypass_man/procon/mode_registry2.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, binaries:) ⇒ Mode

Returns a new instance of Mode.



5
6
7
8
9
# File 'lib/procon_bypass_man/procon/mode_registry2.rb', line 5

def initialize(name: , binaries: )
  self.name = name
  self.binaries = binaries
  self.source_binaries = binaries.dup
end

Instance Attribute Details

#binariesObject

Returns the value of attribute binaries.



3
4
5
# File 'lib/procon_bypass_man/procon/mode_registry2.rb', line 3

def binaries
  @binaries
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/procon_bypass_man/procon/mode_registry2.rb', line 3

def name
  @name
end

#source_binariesObject

Returns the value of attribute source_binaries.



3
4
5
# File 'lib/procon_bypass_man/procon/mode_registry2.rb', line 3

def source_binaries
  @source_binaries
end

Instance Method Details

#next_binaryObject



11
12
13
14
15
16
17
18
# File 'lib/procon_bypass_man/procon/mode_registry2.rb', line 11

def next_binary
  binary = binaries.shift
  unless binary
    self.binaries = source_binaries.dup
    return binaries.shift
  end
  return binary
end