Class: Quicopt::Block

Inherits:
Object
  • Object
show all
Defined in:
lib/quicopt/model.rb

Overview

The variables of one subproblem, declared with Model#block.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, variables) ⇒ Block

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Declared with Model#block, not built directly.



1012
1013
1014
1015
1016
# File 'lib/quicopt/model.rb', line 1012

def initialize(name, variables)
  @name = name
  @variables = variables
  freeze
end

Instance Attribute Details

#name ⇒ String (readonly)

Returns the block's name.

Returns:

  • (String) —

    the block's name



1005
1006
1007
# File 'lib/quicopt/model.rb', line 1005

def name
  @name
end

#variables ⇒ Array<Variable> (readonly)

Returns its variables, in the order given.

Returns:

  • (Array<Variable>) —

    its variables, in the order given



1007
1008
1009
# File 'lib/quicopt/model.rb', line 1007

def variables
  @variables
end

Instance Method Details

#inspect ⇒ String

Returns name and members.

Returns:

  • (String) —

    name and members



1019
1020
1021
# File 'lib/quicopt/model.rb', line 1019

def inspect
  "#<Quicopt::Block #{@name}: #{@variables.join(', ')}>"
end