Class: CType::Primitive
- Inherits:
-
Object
- Object
- CType::Primitive
- Defined in:
- lib/dbc/ctype.rb
Overview
Enum
Instance Method Summary collapse
- #evaluate(identifier) ⇒ Object
-
#initialize(val) ⇒ Primitive
constructor
A new instance of Primitive.
- #insert(val) ⇒ Object
- #to_init_s(ident = nil) ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(val) ⇒ Primitive
Returns a new instance of Primitive.
251 252 253 |
# File 'lib/dbc/ctype.rb', line 251 def initialize(val) @primitives = [val] end |
Instance Method Details
#evaluate(identifier) ⇒ Object
259 260 261 262 |
# File 'lib/dbc/ctype.rb', line 259 def evaluate(identifier) CType.evaluation_error(identifier) unless identifier.empty? self end |
#insert(val) ⇒ Object
255 256 257 258 |
# File 'lib/dbc/ctype.rb', line 255 def insert(val) @primitives.insert(0, val) self end |
#to_init_s(ident = nil) ⇒ Object
266 267 268 269 270 |
# File 'lib/dbc/ctype.rb', line 266 def to_init_s(ident=nil) str = @primitives.join(' ') str << ' ' << ident if ident str end |
#to_s ⇒ Object
263 264 265 |
# File 'lib/dbc/ctype.rb', line 263 def to_s to_init_s() end |