Class: Postsvg::Svg::PathData::Command
- Inherits:
-
Struct
- Object
- Struct
- Postsvg::Svg::PathData::Command
- Defined in:
- lib/postsvg/svg/path_data/command.rb
Overview
Single SVG path command. Opcode is upper-case (absolute) or
lower-case (relative). args is the raw numeric arguments.
Instance Attribute Summary collapse
-
#args ⇒ Object
Returns the value of attribute args.
-
#opcode ⇒ Object
Returns the value of attribute opcode.
Instance Method Summary collapse
Instance Attribute Details
#args ⇒ Object
Returns the value of attribute args
8 9 10 |
# File 'lib/postsvg/svg/path_data/command.rb', line 8 def args @args end |
#opcode ⇒ Object
Returns the value of attribute opcode
8 9 10 |
# File 'lib/postsvg/svg/path_data/command.rb', line 8 def opcode @opcode end |
Instance Method Details
#absolute? ⇒ Boolean
9 |
# File 'lib/postsvg/svg/path_data/command.rb', line 9 def absolute? = opcode == opcode.upcase |
#arity ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/postsvg/svg/path_data/command.rb', line 13 def arity case opcode.upcase when "M", "L", "T" then 2 when "H", "V" then 1 when "C" then 6 when "S", "Q" then 4 when "A" then 7 when "Z" then 0 else 0 end end |
#relative? ⇒ Boolean
11 |
# File 'lib/postsvg/svg/path_data/command.rb', line 11 def relative? = opcode == opcode.downcase |