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



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

def <<(output)
  @outputs << output
end

#allObject



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

def all
  @outputs
end

#to_cfgObject



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

def to_cfg
  type_to_str(nil)
end

#type(type) ⇒ Object



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

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

#type_to_str(want_type) ⇒ Object



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

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

#typesObject



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

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

#unshift(output) ⇒ Object



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

def unshift(output)
  @outputs.unshift output
end