Class: Oxidized::Model::Outputs

Inherits:
Object
  • Object
show all
Defined in:
lib/oxidized/model/outputs.rb

Instance Method Summary collapse

Instance Method Details

#<<(output) ⇒ Object



13
14
15
# File 'lib/oxidized/model/outputs.rb', line 13

def << output
  @outputs << output
end

#allObject



21
22
23
# File 'lib/oxidized/model/outputs.rb', line 21

def all
  @outputs
end

#to_cfgObject



5
6
7
# File 'lib/oxidized/model/outputs.rb', line 5

def to_cfg
  type_to_str(nil)
end

#type(type) ⇒ Object



25
26
27
# File 'lib/oxidized/model/outputs.rb', line 25

def type type
  @outputs.select { |out| out.type==type }
end

#type_to_str(want_type) ⇒ Object



9
10
11
# File 'lib/oxidized/model/outputs.rb', line 9

def type_to_str want_type
  type(want_type).map { |out| out }.join
end

#typesObject



29
30
31
# File 'lib/oxidized/model/outputs.rb', line 29

def types
  @outputs.map { |out| out.type }.uniq.compact
end

#unshift(output) ⇒ Object



17
18
19
# File 'lib/oxidized/model/outputs.rb', line 17

def unshift output
  @outputs.unshift output
end