Module: AstroSubframeOrganizer::Commands::EquipmentOptions
- Included in:
- Init, Organize::Base
- Defined in:
- lib/astro_subframe_organizer/commands/equipment_options.rb
Instance Attribute Summary collapse
-
#equipment_selector ⇒ Object
readonly
Returns the value of attribute equipment_selector.
Class Method Summary collapse
Instance Method Summary collapse
-
#set_equipment(telescope: nil, camera: nil, filter: nil) ⇒ Object
Set the equipment on an equipment selector during organizing.
Instance Attribute Details
#equipment_selector ⇒ Object (readonly)
Returns the value of attribute equipment_selector.
12 13 14 |
# File 'lib/astro_subframe_organizer/commands/equipment_options.rb', line 12 def equipment_selector @equipment_selector end |
Class Method Details
.included(base) ⇒ Object
6 7 8 9 10 |
# File 'lib/astro_subframe_organizer/commands/equipment_options.rb', line 6 def self.included(base) base.option :telescope, type: :string, required: false, desc: 'Name of telescope used to create subframes' base.option :camera, type: :string, required: false, desc: 'Name of camera used to create subframes' base.option :filter, type: :string, required: false, desc: 'Name of filter used to create subframes' end |
Instance Method Details
#set_equipment(telescope: nil, camera: nil, filter: nil) ⇒ Object
Set the equipment on an equipment selector during organizing. If a value is not provided via command line option, the organizer will follow default rules for determing equipment selection:
- If available in filename or FITS headers, and it matches equipment in Config, auto-selected.
- If not determined, will prompt the user to select an option from Config equipment.
Only use this if the command uses equipment selector. Otherwise, use options directly.
21 22 23 24 25 26 27 |
# File 'lib/astro_subframe_organizer/commands/equipment_options.rb', line 21 def set_equipment(telescope: nil, camera: nil, filter: nil) @equipment_selector = EquipmentSelector.new.tap do |eq| eq.telescope = telescope eq.camera = camera eq.filter = filter end end |