Class: EmbedRb::Embed

Inherits:
Object
  • Object
show all
Defined in:
lib/embedrb/embed.rb

Instance Method Summary collapse

Constructor Details

#initialize(options, input) ⇒ Embed



69
70
71
72
73
# File 'lib/embedrb/embed.rb', line 69

def initialize(options, input)
  @options = EmbedRb.deep_merge(DEFAULT_OPTIONS, options)
  @options[:served] = []
  @input = input
end

Instance Method Details

#processObject



75
76
77
78
79
80
81
82
83
84
85
86
87
# File 'lib/embedrb/embed.rb', line 75

def process()
  input = @input
  embeds = []
  output = ''

  PROCESSORS.each {|key, klass|
    if @options[key] && EmbedRb.process_more?(@options, key, embeds)
      output = klass.new(input, output, @options, embeds).process
    end
  }

  EmbedRb.create_text(output, embeds)
end