Class: Nendo::Record
- Inherits:
-
Object
- Object
- Nendo::Record
- Defined in:
- lib/nendo/ruby/types.rb
Instance Attribute Summary collapse
-
#slots ⇒ Object
readonly
Returns the value of attribute slots.
-
#typename ⇒ Object
readonly
Returns the value of attribute typename.
Instance Method Summary collapse
- #get(key) ⇒ Object
-
#initialize(typename, fields) ⇒ Record
constructor
A new instance of Record.
- #set!(key, value) ⇒ Object
Constructor Details
Instance Attribute Details
#slots ⇒ Object (readonly)
Returns the value of attribute slots.
341 342 343 |
# File 'lib/nendo/ruby/types.rb', line 341 def slots @slots end |
#typename ⇒ Object (readonly)
Returns the value of attribute typename.
341 342 343 |
# File 'lib/nendo/ruby/types.rb', line 341 def typename @typename end |
Instance Method Details
#get(key) ⇒ Object
359 360 361 362 363 364 365 |
# File 'lib/nendo/ruby/types.rb', line 359 def get( key ) if @slots.has_key?( key ) @slots[key] else raise ArgumentError, sprintf( "Record <%s> doesn't have key[%s]", typename, key ) end end |
#set!(key, value) ⇒ Object
351 352 353 354 355 356 357 |
# File 'lib/nendo/ruby/types.rb', line 351 def set!( key, value ) if @slots.has_key?( key ) @slots[key] = value else raise ArgumentError, sprintf( "Record <%s> doesn't have key[%s]", typename, key ) end end |