Class: Emfsvg::Pen

Inherits:
Object
  • Object
show all
Defined in:
lib/emfsvg/device_context.rb

Overview

Pen value object: style, width, color.

Constant Summary collapse

SOLID =
0
DASH =
1
DOT =
2
DASHDOT =
3
DASHDOTDOT =
4
NULL =
5
INSIDEFRAME =
6

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(style: SOLID, width: 1, color: Emf::Model::Geometry::Color.black) ⇒ Pen

Returns a new instance of Pen.



153
154
155
156
157
# File 'lib/emfsvg/device_context.rb', line 153

def initialize(style: SOLID, width: 1, color: Emf::Model::Geometry::Color.black)
  @style = style
  @width = width
  @color = color
end

Instance Attribute Details

#colorObject (readonly)

Returns the value of attribute color.



159
160
161
# File 'lib/emfsvg/device_context.rb', line 159

def color
  @color
end

#styleObject (readonly)

Returns the value of attribute style.



159
160
161
# File 'lib/emfsvg/device_context.rb', line 159

def style
  @style
end

#widthObject (readonly)

Returns the value of attribute width.



159
160
161
# File 'lib/emfsvg/device_context.rb', line 159

def width
  @width
end

Class Method Details

.defaultObject



161
162
163
# File 'lib/emfsvg/device_context.rb', line 161

def self.default
  new
end

Instance Method Details

#dupObject



169
170
171
# File 'lib/emfsvg/device_context.rb', line 169

def dup
  Pen.new(style: style, width: width, color: color)
end

#null?Boolean

Returns:

  • (Boolean)


165
166
167
# File 'lib/emfsvg/device_context.rb', line 165

def null?
  style == NULL
end