Class: GemLoader::Scope::Dsl

Inherits:
Object
  • Object
show all
Defined in:
lib/gem_loader/scope/dsl.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(scope, &block) ⇒ Dsl

Returns a new instance of Dsl.



11
12
13
14
# File 'lib/gem_loader/scope/dsl.rb', line 11

def initialize(scope, &block)
  self.scope = scope
  instance_eval(&block) if block
end

Instance Attribute Details

#scope ⇒ Object

Returns the value of attribute scope.



9
10
11
# File 'lib/gem_loader/scope/dsl.rb', line 9

def scope
  @scope
end

Instance Method Details

#gem(name, *args, &block) ⇒ Object



16
17
18
# File 'lib/gem_loader/scope/dsl.rb', line 16

def gem(name, *args, &block)
  self.scope.gem(name).parse_args(*args).dsl(&block)
end

#require(*args) ⇒ Object



20
21
22
# File 'lib/gem_loader/scope/dsl.rb', line 20

def require(*args)
  self.scope.libs << [ args ].flatten
end