Class: NCFileWriter::Dim

Inherits:
Object
  • Object
show all
Includes:
NC
Defined in:
lib/io/netcdf.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from NC

nc_decode, nc_put_att_simple, nc_put_var_all

Constructor Details

#initialize(ncfile, name, len) ⇒ Dim

Returns a new instance of Dim.



458
459
460
461
462
463
464
# File 'lib/io/netcdf.rb', line 458

def initialize (ncfile, name, len)
  @ncfile     = ncfile
  @file_id    = ncfile.file_id
  @name       = name
  @len        = len
  @dim_id     = nc_def_dim(@file_id, @name, @len)
end

Instance Attribute Details

#dim_idObject (readonly)

Returns the value of attribute dim_id.



466
467
468
# File 'lib/io/netcdf.rb', line 466

def dim_id
  @dim_id
end

#nameObject (readonly)

Returns the value of attribute name.



466
467
468
# File 'lib/io/netcdf.rb', line 466

def name
  @name
end

Instance Method Details

#to_iObject



468
469
470
# File 'lib/io/netcdf.rb', line 468

def to_i
  return @len
end