Module: Extractula::OEmbed::ClassMethods
- Defined in:
- lib/extractula/oembed.rb
Instance Method Summary collapse
- #oembed_endpoint(url = nil) ⇒ Object
- #oembed_format_param_required? ⇒ Boolean
- #oembed_max_height(height = nil) ⇒ Object
- #oembed_max_width(width = nil) ⇒ Object
Instance Method Details
#oembed_endpoint(url = nil) ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/extractula/oembed.rb', line 34 def (url = nil) if url @oembed_endpoint = url if @oembed_endpoint.match(/\.(xml|json)$/) @oembed_format_param_required = false @oembed_endpoint.sub!(/\.xml$/, '.json') if $1 == 'xml' else @oembed_format_param_required = true end end @oembed_endpoint end |
#oembed_format_param_required? ⇒ Boolean
57 58 59 |
# File 'lib/extractula/oembed.rb', line 57 def @oembed_format_param_required end |
#oembed_max_height(height = nil) ⇒ Object
52 53 54 55 |
# File 'lib/extractula/oembed.rb', line 52 def (height = nil) @oembed_max_height = height if height @oembed_max_height || OEmbed.max_height end |