Class: BinaryParser::Expression::Token::Variable::Nextbits

Inherits:
BinaryParser::Expression::Token::Variable show all
Defined in:
lib/general_class/expression.rb

Instance Attribute Summary collapse

Attributes inherited from BinaryParser::Expression::Token::Variable

#symbol

Instance Method Summary collapse

Methods inherited from BinaryParser::Expression::Token

#to_rpn

Methods inherited from BinaryParser::Expression

#%, #*, #+, #-, #/, #binary_op, #coerce, control_var, #control_var?, #eval, immediate, #immediate?, length_var, #length_var?, nextbits_var, #nextbits_var?, #to_exp, value_var, #value_var?, #variable_tokens

Constructor Details

#initialize(length) ⇒ Nextbits

Returns a new instance of Nextbits.



150
151
152
153
154
155
# File 'lib/general_class/expression.rb', line 150

def initialize(length)
  unless length.is_a?(Integer) && length > 0
    raise BadManipulationError, "Argument should be positive Integer."
  end
  @length = length
end

Instance Attribute Details

#lengthObject (readonly)

Returns the value of attribute length.



148
149
150
# File 'lib/general_class/expression.rb', line 148

def length
  @length
end