Skip to content

Commit

Permalink
Update template to create a domain
Browse files Browse the repository at this point in the history
  • Loading branch information
azimux committed Mar 4, 2024
1 parent 8827dfa commit 8ba5007
Showing 1 changed file with 2 additions and 25 deletions.
27 changes: 2 additions & 25 deletions templates/src/domain.rb.erb
Original file line number Diff line number Diff line change
@@ -1,31 +1,8 @@
<% module_path[..-2].each do |part| %>
<% module_path.each do |part| %>
module <%= part %>
<% end %>

class <%= module_path.last %> < Foobara::Domain
# class SomeError < RuntimeError
# class << self
# def context_type_declaration
# { foo: :string }
# end
# end
# end

inputs do
# some_input :string, :required, default: "foo"
end

# depends_on SomeOtherDomain

# possible_error SomeError

def execute
# do_something
end

# def validate
# add_runtime_error SomeError.new(message: "kaboom", context: {foo: :bar})
# end
foobara_domain!

<% module_path.size.times do %>
end
Expand Down

0 comments on commit 8ba5007

Please sign in to comment.