Module: Boson::Library::Namespacer

Included in:
Boson::Library
Defined in:
lib/boson/namespacer.rb

Overview

:namespace

Boolean or string which namespaces a library. When true, the library is automatically namespaced to the library’s name. When a string, the library is namespaced to the string. Default is nil.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#namespace(orig = @namespace) ⇒ Object



66
67
68
69
70
71
72
73
74
# File 'lib/boson/namespacer.rb', line 66

def namespace(orig=@namespace)
  @namespace = [String,FalseClass].include?(orig.class) ? orig : begin
    if (@namespace == true || (Boson.config[:auto_namespace] && !@index))
      @namespace = clean_name
    else
      @namespace = false
    end
  end
end

Instance Method Details

#namespace_objectObject

The object a library uses for executing its commands.



62
63
64
# File 'lib/boson/namespacer.rb', line 62

def namespace_object
  @namespace_object ||= namespace ? Boson.invoke(namespace) : Boson.main_object
end