Module: Onebox::Engine::ClassMethods

Defined in:
lib/onebox/engine.rb

Instance Method Summary collapse

Instance Method Details

#===(other) ⇒ Object



72
73
74
75
76
77
78
# File 'lib/onebox/engine.rb', line 72

def ===(other)
  if other.kind_of?(URI)
    !!(other.to_s =~ class_variable_get(:@@matcher))
  else
    super
  end
end

#matches_regexp(r) ⇒ Object



84
85
86
# File 'lib/onebox/engine.rb', line 84

def matches_regexp(r)
  class_variable_set :@@matcher, r
end

#onebox_nameObject

calculates a name for onebox using the class name of engine



89
90
91
# File 'lib/onebox/engine.rb', line 89

def onebox_name
  name.split("::").last.downcase.gsub(/onebox/, "")
end

#priorityObject



80
81
82
# File 'lib/onebox/engine.rb', line 80

def priority
  100
end