Class: RMasm::Primitive
Overview
Base class for all primitives
Instance Attribute Summary collapse
-
#value ⇒ Object
Returns the value of attribute value.
Class Method Summary collapse
- .from_str(str) ⇒ Object
- .range ⇒ Object
-
.valid?(arg) ⇒ Boolean
By default, set the check on a range and wait for an Integer value.
Methods inherited from DataType
Instance Attribute Details
#value ⇒ Object
Returns the value of attribute value.
29 30 31 |
# File 'lib/rmasm/primitive.rb', line 29 def value @value end |
Class Method Details
.from_str(str) ⇒ Object
34 35 36 37 |
# File 'lib/rmasm/primitive.rb', line 34 def self.from_str(str) nil # raise NotImplementedError.new("conversion from string not implemented on #{self}") end |
.range ⇒ Object
30 31 32 |
# File 'lib/rmasm/primitive.rb', line 30 def self.range raise NotImplementedError.new end |
.valid?(arg) ⇒ Boolean
By default, set the check on a range and wait for an Integer value
40 41 42 |
# File 'lib/rmasm/primitive.rb', line 40 def self.valid?(arg) return range === arg && arg.is_a?(Integer) end |