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
103 104 105 106 107 108 109 |
# File 'lib/onebox/engine.rb', line 103 def ===(other) if other.kind_of?(URI) !!(other.to_s =~ class_variable_get(:@@matcher)) else super end end |
#always_https ⇒ Object
124 125 126 |
# File 'lib/onebox/engine.rb', line 124 def always_https @https = true end |
#always_https? ⇒ Boolean
128 129 130 |
# File 'lib/onebox/engine.rb', line 128 def always_https? @https end |
#matches_regexp(r) ⇒ Object
115 116 117 |
# File 'lib/onebox/engine.rb', line 115 def matches_regexp(r) class_variable_set :@@matcher, r end |
#onebox_name ⇒ Object
calculates a name for onebox using the class name of engine
120 121 122 |
# File 'lib/onebox/engine.rb', line 120 def onebox_name name.split("::").last.downcase.gsub(/onebox/, "") end |
#priority ⇒ Object
111 112 113 |
# File 'lib/onebox/engine.rb', line 111 def priority 100 end |