Class: DynamicPDFApi::Iata25BarcodeElement
- Inherits:
-
TextBarcodeElement
- Object
- Element
- BarcodeElement
- TextBarcodeElement
- DynamicPDFApi::Iata25BarcodeElement
- Defined in:
- lib/ruby_client/Elements/Iata25BarcodeElement.rb
Overview
Represents an IATA 2 of 5 barcode element.
This class can be used to place an IATA 2 of 5 barcode on a page.
Instance Attribute Summary collapse
-
#_type ⇒ Object
Returns the value of attribute _type.
-
#height ⇒ Object
Gets or sets the height of the barcode.
-
#include_check_digit ⇒ Object
Gets or sets a value indicating if the check digit should be added to the value.
Attributes inherited from TextBarcodeElement
#_font_name, #_resource, #_text_font, #font_size, #show_text, #text_color
Attributes inherited from BarcodeElement
#_color_name, #value, #x_dimension
Attributes inherited from Element
#_input_value, #_resource, #_text_font, #even_pages, #odd_pages, #placement, #x_offset, #y_offset
Instance Method Summary collapse
-
#initialize(value, height, placement = ElementPlacement::TOP_LEFT, x_offset = 0, y_offset = 0) ⇒ Iata25BarcodeElement
constructor
Initializes a new instance of the Iata25BarcodeElement class.
- #to_json(_options = {}) ⇒ Object
Methods inherited from TextBarcodeElement
Methods inherited from BarcodeElement
Constructor Details
#initialize(value, height, placement = ElementPlacement::TOP_LEFT, x_offset = 0, y_offset = 0) ⇒ Iata25BarcodeElement
Initializes a new instance of the Iata25BarcodeElement class.
20 21 22 23 24 25 |
# File 'lib/ruby_client/Elements/Iata25BarcodeElement.rb', line 20 def initialize(value, height, placement= ElementPlacement::TOP_LEFT, x_offset = 0, y_offset = 0) @_type = ElementType::IATA25_BARCODE @include_check_digit = nil @height = height super(value, placement, x_offset, y_offset) end |
Instance Attribute Details
#_type ⇒ Object
Returns the value of attribute _type.
27 28 29 |
# File 'lib/ruby_client/Elements/Iata25BarcodeElement.rb', line 27 def _type @_type end |
#height ⇒ Object
Gets or sets the height of the barcode.
37 38 39 |
# File 'lib/ruby_client/Elements/Iata25BarcodeElement.rb', line 37 def height @height end |
#include_check_digit ⇒ Object
Gets or sets a value indicating if the check digit should be added to the value.
32 33 34 |
# File 'lib/ruby_client/Elements/Iata25BarcodeElement.rb', line 32 def include_check_digit @include_check_digit end |
Instance Method Details
#to_json(_options = {}) ⇒ Object
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/ruby_client/Elements/Iata25BarcodeElement.rb', line 39 def to_json( = {}) json_array = {} json_array['type'] = 'iata25Barcode' json_array['includeCheckDigit'] = @include_check_digit unless @include_check_digit.nil? json_array['height'] = @height unless @height.nil? #----------------TextBarcodeElement--------------------------------- json_array['font'] = @_font_name unless @_font_name.nil? json_array['textColor'] = @text_color._color_string if !@text_color.nil? && !@text_color._color_string.nil? json_array['fontSize'] = @font_size unless @font_size.nil? json_array['showText'] = @show_text unless @show_text.nil? #----------------barcodeElement-------------------------------- json_array['color'] = @color._color_string if !@color.nil? && !@color._color_string.nil? json_array['xDimension'] = @x_dimension unless @x_dimension.nil? json_array['value'] = @value unless @value.nil? # ------------element--------------------- json_array['placement'] = @placement unless @placement.nil? json_array['xOffset'] = @x_offset unless @x_offset.nil? json_array['yOffset'] = @y_offset unless @y_offset.nil? json_array["evenPages"] = @even_pages unless @even_pages.nil? json_array["oddPages"] = @odd_pages unless @odd_pages.nil? JSON.pretty_generate(json_array) end |