Sha256: cf4a5a2731d1776a1cd8d5c3811125c174773bf02292b1ec886a9151fa69f9a8
Contents?: true
Size: 613 Bytes
Versions: 15
Compression:
Stored size: 613 Bytes
Contents
module Dyna class DSL class DynamoDB include Dyna::TemplateHelper attr_reader :result def initialize(context, tables, &block) @context = context @result = OpenStruct.new({ :tables => tables, }) instance_eval(&block) end private def table(name, &block) if table_names.include?(name) raise "Table `#{name}` is already defined" end @result.tables << Table.new(@context, name, &block).result end def table_names @result.tables.map(&:table_name) end end end end
Version data entries
15 entries across 15 versions & 1 rubygems