Class: Nero::Context

Inherits:
Object
  • Object
show all
Defined in:
lib/nero/context.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(environ:, errors:, dir: nil) ⇒ Context

Returns a new instance of Context.



7
8
9
10
11
# File 'lib/nero/context.rb', line 7

def initialize(environ:, errors:, dir: nil)
  @environ = environ
  @errors = errors
  @dir = dir || File.realpath(".")
end

Instance Attribute Details

#dirObject (readonly)

Returns the value of attribute dir.



5
6
7
# File 'lib/nero/context.rb', line 5

def dir
  @dir
end

#environObject (readonly)

Returns the value of attribute environ.



5
6
7
# File 'lib/nero/context.rb', line 5

def environ
  @environ
end

#errorsObject (readonly)

Returns the value of attribute errors.



5
6
7
# File 'lib/nero/context.rb', line 5

def errors
  @errors
end

Instance Method Details

#add_error(message) ⇒ Object



13
14
15
# File 'lib/nero/context.rb', line 13

def add_error(message)
  @errors << Error.new(message)
end