Class: RubyPost::Range

Inherits:
GraphOption show all
Defined in:
lib/graph.rb

Overview

wraps the setrange function in metapost can use strings or numbers.

Instance Attribute Summary collapse

Instance Method Summary collapse

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

Parameters:

  • value

    the value to set the attribute xmax to.



225
226
227
# File 'lib/graph.rb', line 225

def xmax=(value)
  @xmax = value
end

#xmin=(value) ⇒ Object (writeonly)

Sets the attribute xmin

Parameters:

  • value

    the value to set the attribute xmin to.



225
226
227
# File 'lib/graph.rb', line 225

def xmin=(value)
  @xmin = value
end

#ymax=(value) ⇒ Object (writeonly)

Sets the attribute ymax

Parameters:

  • value

    the value to set the attribute ymax to.



225
226
227
# File 'lib/graph.rb', line 225

def ymax=(value)
  @ymax = value
end

#ymin=(value) ⇒ Object (writeonly)

Sets the attribute ymin

Parameters:

  • value

    the value to set the attribute ymin to.



225
226
227
# File 'lib/graph.rb', line 225

def ymin=(value)
  @ymin = value
end

Instance Method Details

#compileObject



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