Class: RubyPost::Range
- Inherits:
-
GraphOption
- Object
- Object
- Option
- GraphOption
- RubyPost::Range
- Defined in:
- lib/graph.rb
Overview
wraps the setrange function in metapost can use strings or numbers.
Instance Attribute Summary collapse
-
#xmax ⇒ Object
writeonly
Sets the attribute xmax.
-
#xmin ⇒ Object
writeonly
Sets the attribute xmin.
-
#ymax ⇒ Object
writeonly
Sets the attribute ymax.
-
#ymin ⇒ Object
writeonly
Sets the attribute ymin.
Instance Method Summary collapse
- #compile ⇒ Object
-
#initialize(xmin = 'whatever', ymin = 'whatever', xmax = 'whatever', ymax = 'whatever') ⇒ Range
constructor
A new instance of Range.
Constructor Details
#initialize(xmin = 'whatever', ymin = 'whatever', xmax = 'whatever', ymax = 'whatever') ⇒ Range
Returns a new instance of Range.
227 228 229 230 231 232 |
# File 'lib/graph.rb', line 227 def initialize(xmin='whatever', ymin='whatever', xmax='whatever', ymax='whatever') @xmin = xmin @xmax = xmax @ymin = ymin @ymax = ymax end |
Instance Attribute Details
#xmax=(value) ⇒ Object (writeonly)
Sets the attribute xmax
225 226 227 |
# File 'lib/graph.rb', line 225 def xmax=(value) @xmax = value end |
#xmin=(value) ⇒ Object (writeonly)
Sets the attribute xmin
225 226 227 |
# File 'lib/graph.rb', line 225 def xmin=(value) @xmin = value end |
#ymax=(value) ⇒ Object (writeonly)
Sets the attribute ymax
225 226 227 |
# File 'lib/graph.rb', line 225 def ymax=(value) @ymax = value end |
#ymin=(value) ⇒ Object (writeonly)
Sets the attribute ymin
225 226 227 |
# File 'lib/graph.rb', line 225 def ymin=(value) @ymin = value end |
Instance Method Details
#compile ⇒ Object
234 235 236 |
# File 'lib/graph.rb', line 234 def compile 'setrange(' + @xmin.to_s + ', ' + @ymin.to_s + ', ' + @xmax.to_s + ', ' + @ymax.to_s + ");\n" end |