Class: LabelPrinter::Label::AssetRedirect
- Inherits:
-
Object
- Object
- LabelPrinter::Label::AssetRedirect
- Defined in:
- lib/label_printer/label_printer/label/asset_redirect.rb
Overview
rubocop:todo Style/Documentation
Instance Attribute Summary collapse
-
#printables ⇒ Object
readonly
Returns the value of attribute printables.
Instance Method Summary collapse
- #assets ⇒ Object
-
#initialize(options) ⇒ AssetRedirect
constructor
A new instance of AssetRedirect.
- #to_h ⇒ Object
Constructor Details
#initialize(options) ⇒ AssetRedirect
Returns a new instance of AssetRedirect.
6 7 8 9 |
# File 'lib/label_printer/label_printer/label/asset_redirect.rb', line 6 def initialize() @printables = [:printables] @printer_type_class = [:printer_type_class] end |
Instance Attribute Details
#printables ⇒ Object (readonly)
Returns the value of attribute printables
4 5 6 |
# File 'lib/label_printer/label_printer/label/asset_redirect.rb', line 4 def printables @printables end |
Instance Method Details
#assets ⇒ Object
24 25 26 |
# File 'lib/label_printer/label_printer/label/asset_redirect.rb', line 24 def assets printable_assets.each { |asset| asset. if asset..blank? } end |
#to_h ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/label_printer/label_printer/label/asset_redirect.rb', line 11 def to_h case assets.first when Plate if @printer_type_class.double_label? AssetPlateDouble.new(assets).to_h else AssetPlate.new(assets).to_h end when Tube AssetTube.new(assets).to_h end end |