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

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, context, msg = nil) ⇒ 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 = nil)
  super()

  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