Class: Build::Environment::Define

Inherits:
Struct
  • Object
show all
Defined in:
lib/build/environment/constructor.rb

Overview

Represents a deferred class instantiation, binding a class and a configuration block to an environment key.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(klass, &block) ⇒ Define

Initialize a define with a class and an optional configuration block.



16
17
18
# File 'lib/build/environment/constructor.rb', line 16

def initialize(klass, &block)
	super klass, block
end

Instance Attribute Details

#blockObject

Returns the value of attribute block

Returns:

  • (Object)

    the current value of block



12
13
14
# File 'lib/build/environment/constructor.rb', line 12

def block
  @block
end

#klassObject

Returns the value of attribute klass

Returns:

  • (Object)

    the current value of klass



12
13
14
# File 'lib/build/environment/constructor.rb', line 12

def klass
  @klass
end

Instance Method Details

#to_sObject

Return a string representation of this define.



22
23
24
# File 'lib/build/environment/constructor.rb', line 22

def to_s
	"#<#{klass} #{block ? block.source_location.join(':') : 'unknown'}>"
end