Permalink
Browse files

NML_Writer is a Class instead of Module

  • Loading branch information...
1 parent 730c24b commit 8b20f17dec62c66cce628e5b94f7a6eca248eb4c @sajinh committed Apr 4, 2012
Showing with 7 additions and 4 deletions.
  1. +7 −4 README
View
11 README
@@ -53,16 +53,19 @@ A ruby library to manipulate Fortran namelists
nshare << share << {:a => 1}
# Step 2 - Construct a new namelist
- # Push namelist groups to NML_Writer using <<
- NML_Writer << nshare << ngrid << ungrib << nmet
+ # Push namelist groups to NML_Writer using instance_method <<
+
+ nml_writer = NML_Writer.new
+
+ nml_writer << nshare << ngrid << ungrib << nmet
# Write out to STDOUT
- NML_Writer >> STDOUT
+ nml_writer >> STDOUT
# Write to a file or other object supporting puts
outfile = File.new("namelist.wps.asia","w")
- NML_Writer >> outfile
+ nml_writer >> outfile
outfile.close
```

0 comments on commit 8b20f17

Please sign in to comment.