Class: BBK::App::Domains::ByBlock
- Inherits:
-
Object
- Object
- BBK::App::Domains::ByBlock
- Defined in:
- lib/bbk/app/domains/by_block.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #call(route) ⇒ Object
-
#initialize(name, &block) ⇒ ByBlock
constructor
A new instance of ByBlock.
Constructor Details
#initialize(name, &block) ⇒ ByBlock
Returns a new instance of ByBlock.
8 9 10 11 12 13 |
# File 'lib/bbk/app/domains/by_block.rb', line 8 def initialize(name, &block) raise ArgumentError.new('no block') unless block_given? @name = name @block = block end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/bbk/app/domains/by_block.rb', line 6 def name @name end |
Instance Method Details
#call(route) ⇒ Object
15 16 17 |
# File 'lib/bbk/app/domains/by_block.rb', line 15 def call(route) @block.call(route) end |