Class: OEmbed::TemplateResolver::ERBTemplate

Inherits:
Object
  • Object
show all
Defined in:
lib/oembed_links/template_resolver.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(u, d, r) ⇒ ERBTemplate

Returns a new instance of ERBTemplate.



120
121
122
123
124
# File 'lib/oembed_links/template_resolver.rb', line 120

def initialize(u, d, r)
  @url = u
  @data = d
  @response = r
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



118
119
120
# File 'lib/oembed_links/template_resolver.rb', line 118

def data
  @data
end

#responseObject (readonly)

Returns the value of attribute response.



118
119
120
# File 'lib/oembed_links/template_resolver.rb', line 118

def response
  @response
end

#urlObject (readonly)

Returns the value of attribute url.



118
119
120
# File 'lib/oembed_links/template_resolver.rb', line 118

def url
  @url
end

Instance Method Details

#evaluate(contents) ⇒ Object



127
128
129
# File 'lib/oembed_links/template_resolver.rb', line 127

def evaluate(contents)
  ERB.new(contents).result(binding)
end