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.



115
116
117
118
119
# File 'lib/oembed_links/template_resolver.rb', line 115

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

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



113
114
115
# File 'lib/oembed_links/template_resolver.rb', line 113

def data
  @data
end

#responseObject (readonly)

Returns the value of attribute response.



113
114
115
# File 'lib/oembed_links/template_resolver.rb', line 113

def response
  @response
end

#urlObject (readonly)

Returns the value of attribute url.



113
114
115
# File 'lib/oembed_links/template_resolver.rb', line 113

def url
  @url
end

Instance Method Details

#evaluate(contents) ⇒ Object



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

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