Module: Onebox::Engine::ClassMethods
- Defined in:
- lib/onebox/engine.rb
Instance Method Summary collapse
- #===(other) ⇒ Object
- #always_https ⇒ Object
- #always_https? ⇒ Boolean
- #matches_regexp(r) ⇒ Object
-
#onebox_name ⇒ Object
calculates a name for onebox using the class name of engine.
- #priority ⇒ Object
Instance Method Details
#===(other) ⇒ Object
87 88 89 90 91 92 93 |
# File 'lib/onebox/engine.rb', line 87 def ===(other) if other.kind_of?(URI) !!(other.to_s =~ class_variable_get(:@@matcher)) else super end end |
#always_https ⇒ Object
108 109 110 |
# File 'lib/onebox/engine.rb', line 108 def always_https @https = true end |
#always_https? ⇒ Boolean
112 113 114 |
# File 'lib/onebox/engine.rb', line 112 def always_https? @https end |
#matches_regexp(r) ⇒ Object
99 100 101 |
# File 'lib/onebox/engine.rb', line 99 def matches_regexp(r) class_variable_set :@@matcher, r end |
#onebox_name ⇒ Object
calculates a name for onebox using the class name of engine
104 105 106 |
# File 'lib/onebox/engine.rb', line 104 def onebox_name name.split("::").last.downcase.gsub(/onebox/, "") end |
#priority ⇒ Object
95 96 97 |
# File 'lib/onebox/engine.rb', line 95 def priority 100 end |