Module: Presenters::Presenter
- Extended by:
- ActiveSupport::Concern
- Included in:
- PlatePresenter, TubePresenter, TubeRackPresenter
- Defined in:
- app/models/presenters/presenter.rb
Overview
rubocop:todo Style/Documentation
Instance Method Summary collapse
-
#barcode ⇒ String
Formatted barcode string for display.
- #child_assets ⇒ Object
-
#created_on ⇒ String
Human formatted date of creation.
- #default_label_count ⇒ Object
- #default_printer ⇒ Object
-
#input_barcode ⇒ String
Formatted stock plate barcode string for display.
- #inspect ⇒ Object
- #printer_limit ⇒ Object
- #suggest_library_passing? ⇒ Boolean
- #summary ⇒ Object
- #title ⇒ Object
Instance Method Details
#barcode ⇒ String
Formatted barcode string for display
62 63 64 |
# File 'app/models/presenters/presenter.rb', line 62 def (labware.) end |
#child_assets ⇒ Object
77 78 79 |
# File 'app/models/presenters/presenter.rb', line 77 def child_assets nil end |
#created_on ⇒ String
Human formatted date of creation
55 56 57 |
# File 'app/models/presenters/presenter.rb', line 55 def created_on labware.created_at.to_fs(:date_created) end |
#default_label_count ⇒ Object
40 41 42 |
# File 'app/models/presenters/presenter.rb', line 40 def default_label_count @default_label_count ||= Settings.printers['default_count'] end |
#default_printer ⇒ Object
36 37 38 |
# File 'app/models/presenters/presenter.rb', line 36 def default_printer @default_printer ||= Settings.printers[purpose_config.default_printer_type] end |
#input_barcode ⇒ String
Formatted stock plate barcode string for display
69 70 71 |
# File 'app/models/presenters/presenter.rb', line 69 def (labware.stock_plate.try(:barcode)) end |
#inspect ⇒ Object
73 74 75 |
# File 'app/models/presenters/presenter.rb', line 73 def inspect "<#{self.class.name} labware:#{labware.uuid} ...>" end |
#printer_limit ⇒ Object
44 45 46 |
# File 'app/models/presenters/presenter.rb', line 44 def printer_limit @printer_limit ||= Settings.printers['limit'] end |
#suggest_library_passing? ⇒ Boolean
28 29 30 |
# File 'app/models/presenters/presenter.rb', line 28 def suggest_library_passing? active_pipelines.any? { |pl| pl.library_pass?(purpose_name) } end |
#summary ⇒ Object
48 49 50 |
# File 'app/models/presenters/presenter.rb', line 48 def summary summary_items.each { |label, method_symbol| yield label, send(method_symbol) } end |
#title ⇒ Object
32 33 34 |
# File 'app/models/presenters/presenter.rb', line 32 def title purpose_name end |