Class: EmbedRb::Embed

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

Instance Method Summary collapse

Constructor Details

#initialize(options, input) ⇒ Embed

Returns a new instance of Embed.



67
68
69
70
71
# File 'lib/embedrb/embed.rb', line 67

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

Instance Method Details

#processObject



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

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

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

  EmbedRb.create_text(output, embeds)
end