Class: Emf::Model::Geometry::Size
- Inherits:
-
Object
- Object
- Emf::Model::Geometry::Size
- Defined in:
- lib/emf/model/geometry/size.rb
Instance Attribute Summary collapse
-
#cx ⇒ Object
readonly
Returns the value of attribute cx.
-
#cy ⇒ Object
readonly
Returns the value of attribute cy.
Class Method Summary collapse
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?)
- #hash ⇒ Object
-
#initialize(cx:, cy:) ⇒ Size
constructor
A new instance of Size.
- #to_wire ⇒ Object
Constructor Details
#initialize(cx:, cy:) ⇒ Size
Returns a new instance of Size.
7 8 9 10 |
# File 'lib/emf/model/geometry/size.rb', line 7 def initialize(cx:, cy:) @cx = cx @cy = cy end |
Instance Attribute Details
#cx ⇒ Object (readonly)
Returns the value of attribute cx.
12 13 14 |
# File 'lib/emf/model/geometry/size.rb', line 12 def cx @cx end |
#cy ⇒ Object (readonly)
Returns the value of attribute cy.
12 13 14 |
# File 'lib/emf/model/geometry/size.rb', line 12 def cy @cy end |
Class Method Details
.from_wire(wire) ⇒ Object
14 15 16 |
# File 'lib/emf/model/geometry/size.rb', line 14 def self.from_wire(wire) new(cx: wire.cx, cy: wire.cy) end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
22 23 24 |
# File 'lib/emf/model/geometry/size.rb', line 22 def ==(other) other.is_a?(self.class) && cx == other.cx && cy == other.cy end |
#hash ⇒ Object
27 28 29 |
# File 'lib/emf/model/geometry/size.rb', line 27 def hash [self.class, cx, cy].hash end |