Class: JobInvocationComposer::HostIdsTranslator
- Inherits:
-
Object
- Object
- JobInvocationComposer::HostIdsTranslator
- Defined in:
- app/models/job_invocation_composer.rb
Instance Attribute Summary collapse
-
#bookmark ⇒ Object
readonly
Returns the value of attribute bookmark.
-
#host_ids ⇒ Object
readonly
Returns the value of attribute host_ids.
-
#hosts ⇒ Object
readonly
Returns the value of attribute hosts.
-
#scoped_search ⇒ Object
readonly
Returns the value of attribute scoped_search.
Instance Method Summary collapse
-
#initialize(input) ⇒ HostIdsTranslator
constructor
A new instance of HostIdsTranslator.
Constructor Details
#initialize(input) ⇒ HostIdsTranslator
Returns a new instance of HostIdsTranslator.
289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 |
# File 'app/models/job_invocation_composer.rb', line 289 def initialize(input) case input when Bookmark @bookmark = input when Host::Base @hosts = [input] when Array @hosts = input.map do |id| Host::Managed..friendly.find(id) end when String @scoped_search = input else @hosts = input end @scoped_search ||= Targeting.build_query_from_hosts(hosts.map(&:id)) if @hosts end |
Instance Attribute Details
#bookmark ⇒ Object (readonly)
Returns the value of attribute bookmark.
287 288 289 |
# File 'app/models/job_invocation_composer.rb', line 287 def bookmark @bookmark end |
#host_ids ⇒ Object (readonly)
Returns the value of attribute host_ids.
287 288 289 |
# File 'app/models/job_invocation_composer.rb', line 287 def host_ids @host_ids end |
#hosts ⇒ Object (readonly)
Returns the value of attribute hosts.
287 288 289 |
# File 'app/models/job_invocation_composer.rb', line 287 def hosts @hosts end |
#scoped_search ⇒ Object (readonly)
Returns the value of attribute scoped_search.
287 288 289 |
# File 'app/models/job_invocation_composer.rb', line 287 def scoped_search @scoped_search end |