Module: Onebox::Engine::ClassMethods
- Defined in:
- lib/onebox/engine.rb
Instance Method Summary collapse
- #===(other) ⇒ Object
- #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
94 95 96 97 98 99 100 |
# File 'lib/onebox/engine.rb', line 94 def ===(other) if other.kind_of?(URI) !!(other.to_s =~ class_variable_get(:@@matcher)) else super end end |
#matches_regexp(r) ⇒ Object
106 107 108 |
# File 'lib/onebox/engine.rb', line 106 def matches_regexp(r) class_variable_set :@@matcher, r end |
#onebox_name ⇒ Object
calculates a name for onebox using the class name of engine
111 112 113 |
# File 'lib/onebox/engine.rb', line 111 def onebox_name name.split("::").last.downcase.gsub(/onebox/, "") end |
#priority ⇒ Object
102 103 104 |
# File 'lib/onebox/engine.rb', line 102 def priority 100 end |