Class: Onebox::Engine::StackExchangeOnebox
- Inherits:
-
Object
- Object
- Onebox::Engine::StackExchangeOnebox
- Includes:
- Onebox::Engine, JSON, LayoutSupport
- Defined in:
- lib/onebox/engine/stack_exchange_onebox.rb
Constant Summary
Constants included from Onebox::Engine
Instance Attribute Summary
Attributes included from Onebox::Engine
#errors, #options, #timeout, #uri
Class Method Summary collapse
Instance Method Summary collapse
Methods included from LayoutSupport
Methods included from Onebox::Engine
all_iframe_origins, engines, included, #initialize, origins_to_regexes, #placeholder_html, #to_html
Class Method Details
.domains ⇒ Object
10 11 12 13 |
# File 'lib/onebox/engine/stack_exchange_onebox.rb', line 10 def self.domains %w(stackexchange.com stackoverflow.com superuser.com serverfault.com askubuntu.com stackapps.com mathoverflow.net) .map { |domain| Regexp.escape(domain) } end |
Instance Method Details
#always_https? ⇒ Boolean
17 18 19 |
# File 'lib/onebox/engine/stack_exchange_onebox.rb', line 17 def always_https? uri.host.split('.').length <= 3 end |