Class: GeoRuby::Shp4r::Dbf::Field
- Inherits:
-
Object
- Object
- GeoRuby::Shp4r::Dbf::Field
- Defined in:
- lib/geo_ruby/shp4r/dbf.rb
Instance Attribute Summary collapse
-
#decimal ⇒ Object
readonly
Returns the value of attribute decimal.
-
#length ⇒ Object
readonly
Returns the value of attribute length.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(name, type, length, decimal = 0) ⇒ Field
constructor
A new instance of Field.
Constructor Details
#initialize(name, type, length, decimal = 0) ⇒ Field
Returns a new instance of Field.
166 167 168 169 170 171 172 |
# File 'lib/geo_ruby/shp4r/dbf.rb', line 166 def initialize(name, type, length, decimal = 0) raise FieldError, "field length must be greater than 0" unless length > 0 if type == 'N' and decimal != 0 type = 'F' end @name, @type, @length, @decimal = name.strip, type,length, decimal end |
Instance Attribute Details
#decimal ⇒ Object (readonly)
Returns the value of attribute decimal.
164 165 166 |
# File 'lib/geo_ruby/shp4r/dbf.rb', line 164 def decimal @decimal end |
#length ⇒ Object (readonly)
Returns the value of attribute length.
164 165 166 |
# File 'lib/geo_ruby/shp4r/dbf.rb', line 164 def length @length end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
164 165 166 |
# File 'lib/geo_ruby/shp4r/dbf.rb', line 164 def name @name end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
164 165 166 |
# File 'lib/geo_ruby/shp4r/dbf.rb', line 164 def type @type end |