Class: Dizby::RefinedProtocol
- Inherits:
-
Object
- Object
- Dizby::RefinedProtocol
- Defined in:
- lib/dizby/protocol/refined.rb
Instance Attribute Summary collapse
-
#regex
readonly
Returns the value of attribute regex.
Instance Method Summary collapse
- #call(*args)
-
#initialize(regex, &block) ⇒ RefinedProtocol
constructor
A new instance of RefinedProtocol.
Constructor Details
#initialize(regex, &block) ⇒ RefinedProtocol
Returns a new instance of RefinedProtocol.
14 15 16 17 |
# File 'lib/dizby/protocol/refined.rb', line 14 def initialize(regex, &block) @regex = /^#{format(regex, Dizby::PROTOCOL_REGEX)}$/ @block = block end |
Instance Attribute Details
#regex (readonly)
Returns the value of attribute regex.
19 20 21 |
# File 'lib/dizby/protocol/refined.rb', line 19 def regex @regex end |
Instance Method Details
#call(*args)
21 22 23 |
# File 'lib/dizby/protocol/refined.rb', line 21 def call(*args) @block.call(*args) end |