Class: ConvenientService::Support::DependencyContainer::Entities::Namespace

Inherits:
Object
  • Object
show all
Defined in:
lib/convenient_service/support/dependency_container/entities/namespace.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:) ⇒ void

Parameters:

  • name (String, Symbol)


23
24
25
# File 'lib/convenient_service/support/dependency_container/entities/namespace.rb', line 23

def initialize(name:)
  @name = name
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



17
18
19
# File 'lib/convenient_service/support/dependency_container/entities/namespace.rb', line 17

def name
  @name
end

Instance Method Details

#==(other) ⇒ Boolean?

Parameters:

  • other (Object)

    Can be any type.

Returns:

  • (Boolean, nil)


54
55
56
57
58
59
60
# File 'lib/convenient_service/support/dependency_container/entities/namespace.rb', line 54

def ==(other)
  return unless other.instance_of?(self.class)

  return false if name != other.name

  true
end

#bodyProc

Returns:

  • (Proc)


30
31
32
# File 'lib/convenient_service/support/dependency_container/entities/namespace.rb', line 30

def body
  @body ||= -> { namespace }
end

#define_method(name, &body) ⇒ Symbol

Parameters:

  • name (String, Symbol)
  • body (Proc)

Returns:

  • (Symbol)


46
47
48
# File 'lib/convenient_service/support/dependency_container/entities/namespace.rb', line 46

def define_method(name, &body)
  define_singleton_method(name, &body)
end

#namespacesConvenientService::Support::DependencyContainer::Entities::NamespaceCollection



37
38
39
# File 'lib/convenient_service/support/dependency_container/entities/namespace.rb', line 37

def namespaces
  @namespaces ||= Entities::NamespaceCollection.new
end