Class: Prependers::Annotate::Namespace

Inherits:
Module
  • Object
show all
Defined in:
lib/prependers/annotate/namespace.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(namespace) ⇒ Namespace

Returns a new instance of Namespace.



12
13
14
# File 'lib/prependers/annotate/namespace.rb', line 12

def initialize(namespace)
  @namespace = namespace
end

Instance Attribute Details

#namespaceObject (readonly)

Returns the value of attribute namespace.



6
7
8
# File 'lib/prependers/annotate/namespace.rb', line 6

def namespace
  @namespace
end

Class Method Details

.[](namespace) ⇒ Object



8
9
10
# File 'lib/prependers/annotate/namespace.rb', line 8

def self.[](namespace)
  new(namespace)
end

Instance Method Details

#included(base) ⇒ Object



16
17
18
19
20
21
22
# File 'lib/prependers/annotate/namespace.rb', line 16

def included(base)
  base.singleton_class.class_eval <<~RUBY, __FILE__, __LINE__ + 1
    def __prependers_namespace__
      #{@namespace}
    end
  RUBY
end