Class: OxPrinter
- Inherits:
-
AbstractResource
- Object
- AbstractResource
- OxPrinter
- Defined in:
- app/models/ox_printer.rb
Instance Attribute Summary collapse
-
#snap_shot ⇒ Object
Returns the value of attribute snap_shot.
Instance Method Summary collapse
Instance Attribute Details
#snap_shot ⇒ Object
Returns the value of attribute snap_shot.
5 6 7 |
# File 'app/models/ox_printer.rb', line 5 def snap_shot @snap_shot end |
Instance Method Details
#defer(parent) ⇒ Object
31 32 33 |
# File 'app/models/ox_printer.rb', line 31 def defer parent printables.where(printable: parent).first.update_columns( preferred: false ) end |
#list_title ⇒ Object
18 19 20 |
# File 'app/models/ox_printer.rb', line 18 def list_title name end |
#prefer(parent) ⇒ Object
26 27 28 29 |
# File 'app/models/ox_printer.rb', line 26 def prefer parent parent.printables.each{ |p| p.update_columns(preferred: false) } printables.where(printable: parent).first.update_columns( preferred: true ) end |
#preferred?(parent) ⇒ Boolean
22 23 24 |
# File 'app/models/ox_printer.rb', line 22 def preferred? parent printables.where(printable: parent).first.preferred? end |