Class: Observ::AgentSelectPresenter
- Inherits:
-
Object
- Object
- Observ::AgentSelectPresenter
- Defined in:
- app/presenters/observ/agent_select_presenter.rb
Instance Attribute Summary collapse
-
#agents ⇒ Object
readonly
Returns the value of attribute agents.
Class Method Summary collapse
-
.options(agents: Observ::AgentProvider.all_agents) ⇒ Array<Array<String>>
Convenience class method that injects agents from Observ::AgentProvider Useful when you don't need to filter or transform agents.
Instance Method Summary collapse
-
#initialize(agents:) ⇒ AgentSelectPresenter
constructor
Initialize with dependency injection.
-
#options ⇒ Array<Array<String>>
Returns formatted options for Rails select helper Format: [[display_name, identifier], ...].
Constructor Details
#initialize(agents:) ⇒ AgentSelectPresenter
Initialize with dependency injection
26 27 28 |
# File 'app/presenters/observ/agent_select_presenter.rb', line 26 def initialize(agents:) @agents = agents end |
Instance Attribute Details
#agents ⇒ Object (readonly)
Returns the value of attribute agents.
22 23 24 |
# File 'app/presenters/observ/agent_select_presenter.rb', line 22 def agents @agents end |
Class Method Details
.options(agents: Observ::AgentProvider.all_agents) ⇒ Array<Array<String>>
Convenience class method that injects agents from Observ::AgentProvider Useful when you don't need to filter or transform agents
41 42 43 |
# File 'app/presenters/observ/agent_select_presenter.rb', line 41 def self.(agents: Observ::AgentProvider.all_agents) new(agents: agents). end |
Instance Method Details
#options ⇒ Array<Array<String>>
Returns formatted options for Rails select helper Format: [[display_name, identifier], ...]
33 34 35 |
# File 'app/presenters/observ/agent_select_presenter.rb', line 33 def [default_option] + end |