Class: DynamicPDFApi::LineStyle
- Inherits:
-
Object
- Object
- DynamicPDFApi::LineStyle
- Defined in:
- lib/ruby_client/LineStyle.rb
Overview
Represents a style of line.
Instance Attribute Summary collapse
-
#_line_style_string ⇒ Object
Returns the value of attribute _line_style_string.
Class Method Summary collapse
-
.dash ⇒ Object
Gets a dashed line.
-
.dash_large ⇒ Object
Gets a line with large dashes.
-
.dash_small ⇒ Object
Gets a line with small dashes.
-
.dots ⇒ Object
Gets a dotted line.
-
.none ⇒ Object
Gets a invisible line.
-
.solid ⇒ Object
Gets a solid line.
Instance Method Summary collapse
-
#initialize(line, dash_phase = 0) ⇒ LineStyle
constructor
Initializes a new instance of the LineStyle class.
- #to_json(_options = {}) ⇒ Object
Constructor Details
#initialize(line, dash_phase = 0) ⇒ LineStyle
Initializes a new instance of the LineStyle class.
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/ruby_client/LineStyle.rb', line 12 def initialize(line, dash_phase = 0) if line.is_a?(Array) str_line_style = '[' (0..(line.length - 1)).each do |i| val = line[i] str_line_style = if i == (line.length - 1) str_line_style + format('%.2f', val) else "#{str_line_style}#{format('%.2f', val)}," end end str_line_style += ']' str_line_style += format('%.2f', dash_phase) if dash_phase != 0 @_line_style_string = str_line_style else @_line_style_string = line end end |
Instance Attribute Details
#_line_style_string ⇒ Object
Returns the value of attribute _line_style_string.
31 32 33 |
# File 'lib/ruby_client/LineStyle.rb', line 31 def _line_style_string @_line_style_string end |
Class Method Details
.dash ⇒ Object
Gets a dashed line.
57 58 59 |
# File 'lib/ruby_client/LineStyle.rb', line 57 def self.dash LineStyle.new('dash') end |
.dash_large ⇒ Object
Gets a line with large dashes.
64 65 66 |
# File 'lib/ruby_client/LineStyle.rb', line 64 def self.dash_large LineStyle.new('dashLarge') end |
.dash_small ⇒ Object
Gets a line with small dashes.
50 51 52 |
# File 'lib/ruby_client/LineStyle.rb', line 50 def self.dash_small LineStyle.new('dashSmall') end |
.dots ⇒ Object
Gets a dotted line.
43 44 45 |
# File 'lib/ruby_client/LineStyle.rb', line 43 def self.dots LineStyle.new('dots') end |
Instance Method Details
#to_json(_options = {}) ⇒ Object
75 76 77 |
# File 'lib/ruby_client/LineStyle.rb', line 75 def to_json( = {}) JSON.pretty_generate({}) end |