Class: RubyPost::Rotate

Inherits:
Option show all
Defined in:
lib/options.rb

Overview

Wraps the rotated metapost command

Direct Known Subclasses

Rotated

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(degrees = 0) ⇒ Rotate

Returns a new instance of Rotate.



133
134
135
# File 'lib/options.rb', line 133

def initialize(degrees=0)
  @degrees = degrees
end

Instance Attribute Details

#degrees=(value) ⇒ Object (writeonly)

Sets the attribute degrees

Parameters:

  • value

    the value to set the attribute degrees to.



131
132
133
# File 'lib/options.rb', line 131

def degrees=(value)
  @degrees = value
end

Instance Method Details

#compileObject



143
144
145
# File 'lib/options.rb', line 143

def compile
  'rotated ' + @degrees.to_s
end

#radians=(rads) ⇒ Object

set the angle in radiians



138
139
140
141
# File 'lib/options.rb', line 138

def radians=(rads)
  @degrees = 180.0*rads/Math::PI
  self
end