Class: NetCDF::Attribute

Inherits:
CDMNode show all
Defined in:
lib/netcdf/attribute.rb

Overview

An Attribute has a name and a value, used for associating arbitrary metadata with a Variable or a Group. The value can be a one dimensional array of Strings or numeric values. Attributes are immutable.

Direct Known Subclasses

AttributeWriter

Instance Attribute Summary

Attributes inherited from CDMNode

#netcdf_elmt

Instance Method Summary collapse

Methods inherited from CDMNode

#get_full_name, #get_short_name, #initialize

Constructor Details

This class inherits a constructor from NetCDF::CDMNode

Instance Method Details

#array?Boolean



Returns:

  • (Boolean)

81
82
83
# File 'lib/netcdf/attribute.rb', line 81

def array?
  @netcdf_elmt.isArray()
end

#data_typeObject




41
42
43
# File 'lib/netcdf/attribute.rb', line 41

def data_type
  @netcdf_elmt.getDataType().toString()
end

#lengthObject




49
50
51
# File 'lib/netcdf/attribute.rb', line 49

def length
  @netcdf_elmt.getLength()
end

#numeric_value(index = 0) ⇒ Object




57
58
59
# File 'lib/netcdf/attribute.rb', line 57

def numeric_value(index = 0)
  @netcdf_elmt.getNumericValue(index)
end

#string?Boolean



Returns:

  • (Boolean)

89
90
91
# File 'lib/netcdf/attribute.rb', line 89

def string?
  @netcdf_elmt.isString()
end

#string_value(index = 0) ⇒ Object




65
66
67
# File 'lib/netcdf/attribute.rb', line 65

def string_value(index = 0)
  @netcdf_elmt.getStringValue(index)
end

#to_string(strict = false) ⇒ Object




105
106
107
# File 'lib/netcdf/attribute.rb', line 105

def to_string(strict = false)
  @netcdf_elmt.toString(strict)
end

#unsigned?Boolean



Returns:

  • (Boolean)

97
98
99
# File 'lib/netcdf/attribute.rb', line 97

def unsigned?
  @netcdf_elmt.isUnsigned()
end

#value(index = 0) ⇒ Object




73
74
75
# File 'lib/netcdf/attribute.rb', line 73

def value(index = 0)
  @netcdf_elmt.getValue(index)
end

#write_cdl(formater, strict = false) ⇒ Object


Needs to be correctly rubyfied



113
114
115
# File 'lib/netcdf/attribute.rb', line 113

def write_cdl(formater, strict = false)
  @netcdf_elmt.write_cdl(formater, strict)
end