Class: Rips::Variables::Variable

Inherits:
Object
  • Object
show all
Defined in:
lib/rips/variables/variable.rb

Direct Known Subclasses

Address, Inmediate, Port, Register

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(length) ⇒ Variable

Returns a new instance of Variable.



11
12
13
# File 'lib/rips/variables/variable.rb', line 11

def initialize (length)
  @length = length
end

Instance Attribute Details

#lengthObject (readonly)

Returns the value of attribute length.



8
9
10
# File 'lib/rips/variables/variable.rb', line 8

def length
  @length
end

Instance Method Details

#error(value) ⇒ Object

Return error message about incorrent syntax



16
17
18
# File 'lib/rips/variables/variable.rb', line 16

def error (value)
  "unexpected `#{value}` (expected a `#{self.class.to_s.split(':').last}` argument like `#{@syntax}`)"
end