Class: NumRu::GribDim
- Inherits:
-
Object
- Object
- NumRu::GribDim
- Defined in:
- lib/numru/grib/grib.rb
Overview
class GribVar
Instance Attribute Summary collapse
-
#length ⇒ Object
(also: #total)
readonly
Returns the value of attribute length.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#var ⇒ Object
readonly
Returns the value of attribute var.
Instance Method Summary collapse
- #[](*ind) ⇒ Object
- #att(key) ⇒ Object
- #att_names ⇒ Object
- #get ⇒ Object
-
#initialize(var, name) ⇒ GribDim
constructor
A new instance of GribDim.
- #inspect ⇒ Object
- #put(ary) ⇒ Object
- #put_att(key, val) ⇒ Object (also: #set_att)
- #typecode ⇒ Object
- #val ⇒ Object
Constructor Details
#initialize(var, name) ⇒ GribDim
Returns a new instance of GribDim.
404 405 406 407 408 |
# File 'lib/numru/grib/grib.rb', line 404 def initialize(var,name) @var = var @name = name @attr = Hash.new end |
Instance Attribute Details
#length ⇒ Object (readonly) Also known as: total
Returns the value of attribute length.
403 404 405 |
# File 'lib/numru/grib/grib.rb', line 403 def length @length end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
403 404 405 |
# File 'lib/numru/grib/grib.rb', line 403 def name @name end |
#var ⇒ Object (readonly)
Returns the value of attribute var.
403 404 405 |
# File 'lib/numru/grib/grib.rb', line 403 def var @var end |
Instance Method Details
#[](*ind) ⇒ Object
423 424 425 |
# File 'lib/numru/grib/grib.rb', line 423 def [](*ind) return val[*ind] end |
#att(key) ⇒ Object
435 436 437 |
# File 'lib/numru/grib/grib.rb', line 435 def att(key) @attr[key] end |
#att_names ⇒ Object
438 439 440 |
# File 'lib/numru/grib/grib.rb', line 438 def att_names @attr.keys end |
#get ⇒ Object
410 411 412 |
# File 'lib/numru/grib/grib.rb', line 410 def get @ary end |
#inspect ⇒ Object
441 442 443 |
# File 'lib/numru/grib/grib.rb', line 441 def inspect "GribDim: #{name} length=#{length}" end |
#put(ary) ⇒ Object
426 427 428 429 430 |
# File 'lib/numru/grib/grib.rb', line 426 def put(ary) @ary = ary @length = val.length return @ary end |
#put_att(key, val) ⇒ Object Also known as: set_att
431 432 433 |
# File 'lib/numru/grib/grib.rb', line 431 def put_att(key,val) @attr[key]=val end |
#typecode ⇒ Object
413 414 415 416 417 418 419 |
# File 'lib/numru/grib/grib.rb', line 413 def typecode if NArray===@ary @ary.typecode elsif Array===@ary @ary[0]["value"].typecode end end |
#val ⇒ Object
420 421 422 |
# File 'lib/numru/grib/grib.rb', line 420 def val return @ary end |