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, define_mode = true) ⇒ Dim

Returns a new instance of Dim.



625
626
627
628
629
630
631
632
633
634
635
# File 'lib/io/netcdf.rb', line 625

def initialize (ncfile, name, len, define_mode = true)
  @ncfile     = ncfile
  @file_id    = ncfile.file_id
  @name       = name
  @len        = len
  if define_mode
    @dim_id     = nc_def_dim(@file_id, @name, @len)
  else
    @dim_id     = nc_inq_dimid(@file_id, @name)        
  end
end

Instance Attribute Details

#lenObject (readonly)

Returns the value of attribute len.



637
638
639
# File 'lib/io/netcdf.rb', line 637

def len
  @len
end

#nameObject (readonly)

Returns the value of attribute name.



637
638
639
# File 'lib/io/netcdf.rb', line 637

def name
  @name
end

Instance Method Details

#to_iObject



639
640
641
# File 'lib/io/netcdf.rb', line 639

def to_i
  return @dim_id
end