Exception: Bade::Runtime::Block::MissingBlockDefinitionError

Inherits:
RuntimeError show all
Defined in:
lib/bade/runtime/block.rb

Instance Attribute Summary collapse

Attributes inherited from RuntimeError

#print_locations_warning, #template_backtrace

Instance Method Summary collapse

Methods inherited from RuntimeError

#__formatted_backtrace, #cause, process_locations, #to_s, wrap_existing_error

Constructor Details

#initialize(name, context, msg, template_backtrace) ⇒ MissingBlockDefinitionError

Returns a new instance of MissingBlockDefinitionError.



17
18
19
20
21
22
23
24
# File 'lib/bade/runtime/block.rb', line 17

def initialize(name, context, msg, template_backtrace)
  super(msg, template_backtrace)

  self.name = name
  self.context = context

  @message = msg
end

Instance Attribute Details

#contextSymbol

Returns context of missing block, allowed values are :render and :call.

Returns:

  • (Symbol)

    context of missing block, allowed values are :render and :call



15
16
17
# File 'lib/bade/runtime/block.rb', line 15

def context
  @context
end

#nameString

Returns:



11
12
13
# File 'lib/bade/runtime/block.rb', line 11

def name
  @name
end

Instance Method Details

#messageObject



26
27
28
# File 'lib/bade/runtime/block.rb', line 26

def message
  @message || "Block `#{name}` must have block definition to #{context}."
end