Class: Strapper::Registry

Inherits:
Object
  • Object
show all
Defined in:
lib/strapper/registry.rb

Constant Summary collapse

@@registered_keywords =
{}

Class Method Summary collapse

Class Method Details

.add(keyword_mapping) ⇒ Object



6
7
8
# File 'lib/strapper/registry.rb', line 6

def self.add(keyword_mapping)
  @@registered_keywords.merge!(keyword_mapping)
end

.class_for_keyword(keyword) ⇒ Object



14
15
16
# File 'lib/strapper/registry.rb', line 14

def self.class_for_keyword(keyword)
  @@registered_keywords[keyword]
end

.keyword?(keyword) ⇒ Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/strapper/registry.rb', line 10

def self.keyword?(keyword)
  !!@@registered_keywords[keyword]
end