Class: Gerber::Layer
- Inherits:
-
Object
- Object
- Gerber::Layer
- Defined in:
- lib/gerber/layer.rb,
lib/gerber/layer/parser.rb
Defined Under Namespace
Classes: Parser
Instance Attribute Summary collapse
-
#geometry ⇒ Object
Returns the value of attribute geometry.
-
#name ⇒ Object
Returns the value of attribute name.
-
#polarity ⇒ Object
Returns the value of attribute polarity.
-
#repeat ⇒ Object
Returns the value of attribute repeat.
-
#step ⇒ Object
Returns the value of attribute step.
Accessors collapse
Instance Method Summary collapse
-
#initialize(*args) ⇒ Layer
constructor
A new instance of Layer.
Constructor Details
#initialize(*args) ⇒ Layer
Returns a new instance of Layer.
11 12 13 14 15 16 17 18 19 |
# File 'lib/gerber/layer.rb', line 11 def initialize(*args) super self.geometry = [] @polarity = :dark @repeat = Vector[1,1] @step = Vector[0,0] @units = nil end |
Instance Attribute Details
#geometry ⇒ Object
Returns the value of attribute geometry.
9 10 11 |
# File 'lib/gerber/layer.rb', line 9 def geometry @geometry end |
#name ⇒ Object
Returns the value of attribute name.
9 10 11 |
# File 'lib/gerber/layer.rb', line 9 def name @name end |
#polarity ⇒ Object
Returns the value of attribute polarity.
9 10 11 |
# File 'lib/gerber/layer.rb', line 9 def polarity @polarity end |
#repeat ⇒ Object
Returns the value of attribute repeat.
9 10 11 |
# File 'lib/gerber/layer.rb', line 9 def repeat @repeat end |
#step ⇒ Object
Returns the value of attribute step.
9 10 11 |
# File 'lib/gerber/layer.rb', line 9 def step @step end |
Instance Method Details
#empty? ⇒ Boolean
22 23 24 |
# File 'lib/gerber/layer.rb', line 22 def empty? self.geometry.empty? end |
#set_inches ⇒ Object
26 27 28 |
# File 'lib/gerber/layer.rb', line 26 def set_inches @units = 'inch' end |
#set_millimeters ⇒ Object
30 31 32 |
# File 'lib/gerber/layer.rb', line 30 def set_millimeters @units = 'millimeters' end |