Module: Lita::Namespace
- Included in:
- Adapter
- Defined in:
- lib/lita/namespace.rb
Overview
A mixin for setting and getting a plugin’s namespace.
Instance Method Summary collapse
-
#namespace(value = nil) ⇒ String
Gets (and optionally sets) the namespace for a plugin.
Instance Method Details
#namespace(value = nil) ⇒ String
Gets (and optionally sets) the namespace for a plugin. The namespace is generated from the class’s name by default.
11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/lita/namespace.rb', line 11 def namespace(value = nil) @namespace = value.to_s if value string_name = defined?(@namespace) ? @namespace : name if string_name Util.underscore(string_name.split("::").last) else raise I18n.t("lita.plugin.name_required") end end |