Sha256: 079af60c9c0a46cf905ed2a004725030e4aa3a6a9bec7d10eca2a5b5ac5c424b

Contents?: true

Size: 375 Bytes

Versions: 36

Compression:

Stored size: 375 Bytes

Contents

module Schemacop::V2
  class NodeWithBlock < Node
    class_attribute :block_methods
    self.block_methods = [].freeze

    def self.block_method(name)
      self.block_methods += [name]
    end

    def exec_block(&block)
      return unless block_given?

      se = Schemacop::ScopedEnv.new(self, self.class.block_methods)
      se.instance_exec(&block)
    end
  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
schemacop-3.0.29 lib/schemacop/v2/node_with_block.rb
schemacop-3.0.28 lib/schemacop/v2/node_with_block.rb
schemacop-3.0.27 lib/schemacop/v2/node_with_block.rb
schemacop-3.0.26 lib/schemacop/v2/node_with_block.rb
schemacop-3.0.25 lib/schemacop/v2/node_with_block.rb
schemacop-3.0.24 lib/schemacop/v2/node_with_block.rb
schemacop-3.0.23 lib/schemacop/v2/node_with_block.rb
schemacop-3.0.22 lib/schemacop/v2/node_with_block.rb
schemacop-3.0.21 lib/schemacop/v2/node_with_block.rb
schemacop-3.0.20 lib/schemacop/v2/node_with_block.rb
schemacop-3.0.19 lib/schemacop/v2/node_with_block.rb
schemacop-3.0.18 lib/schemacop/v2/node_with_block.rb
schemacop-3.0.17 lib/schemacop/v2/node_with_block.rb
schemacop-3.0.16 lib/schemacop/v2/node_with_block.rb
schemacop-3.0.15 lib/schemacop/v2/node_with_block.rb
schemacop-3.0.14 lib/schemacop/v2/node_with_block.rb
schemacop-3.0.13 lib/schemacop/v2/node_with_block.rb
schemacop-3.0.12 lib/schemacop/v2/node_with_block.rb
schemacop-3.0.11 lib/schemacop/v2/node_with_block.rb
schemacop-3.0.10 lib/schemacop/v2/node_with_block.rb