Class: ActiveProject::Configurations::TrelloConfiguration

Inherits:
BaseAdapterConfiguration show all
Defined in:
lib/active_project/configurations/trello_configuration.rb

Overview

Holds Trello-specific configuration options.

Instance Attribute Summary collapse

Attributes inherited from BaseAdapterConfiguration

#options

Instance Method Summary collapse

Methods inherited from BaseAdapterConfiguration

#method_missing, #respond_to_missing?, #retry_options

Constructor Details

#initialize(options = {}) ⇒ TrelloConfiguration

Returns a new instance of TrelloConfiguration.



22
23
24
25
# File 'lib/active_project/configurations/trello_configuration.rb', line 22

def initialize(options = {})
  super
  @status_mappings = options.delete(:status_mappings) || {}
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class ActiveProject::Configurations::BaseAdapterConfiguration

Instance Attribute Details

#status_mappingsHash

Supports expanded status vocabulary: :open, :in_progress, :blocked, :on_hold, :closed

Examples:

{
  'board_id_1' => {
    'list_id_backlog' => :open,
    'list_id_progress' => :in_progress,
    'list_id_blocked' => :blocked,
    'list_id_done' => :closed
  },
  'board_id_2' => { 'Done List Name' => :closed } # Using names (less reliable)
}

Returns:

  • (Hash)

    Mappings from Board IDs to List ID/Name to Status Symbol.



20
21
22
# File 'lib/active_project/configurations/trello_configuration.rb', line 20

def status_mappings
  @status_mappings
end

Instance Method Details

#freezeObject



43
44
45
46
47
48
# File 'lib/active_project/configurations/trello_configuration.rb', line 43

def freeze
  # Ensure nested hashes are also frozen
  @status_mappings.each_value(&:freeze)
  @status_mappings.freeze
  super
end