Class: Embedda

Inherits:
Object
  • Object
show all
Defined in:
lib/embedda.rb,
lib/embedda/filters/vimeo.rb,
lib/embedda/filters/youtube.rb,
lib/embedda/filters/provider.rb,
lib/embedda/filters/soundcloud.rb

Defined Under Namespace

Modules: Filters Classes: UnknownFilter

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(string_to_process, options = {}) ⇒ Embedda

Returns a new instance of Embedda.



12
13
14
15
# File 'lib/embedda.rb', line 12

def initialize(string_to_process, options = {})
  @options = defaultize_options(options)
  @string  = string_to_process.to_s
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



10
11
12
# File 'lib/embedda.rb', line 10

def options
  @options
end

#stringObject (readonly)

Returns the value of attribute string.



10
11
12
# File 'lib/embedda.rb', line 10

def string
  @string
end

Instance Method Details

#embedObject



17
18
19
20
21
# File 'lib/embedda.rb', line 17

def embed
  return @string if @string.empty?
  process_string_with_all_filters
  @string
end