Sha256: 101ba0642ebfe9fe6285925ced6a77a24d62b15bf54be577c5f05e7a1e1baf4d

Contents?: true

Size: 643 Bytes

Versions: 6

Compression:

Stored size: 643 Bytes

Contents

module <%= module_name %>

  # TODO: add a description
  class <%= class_name %> < Hexx::UseCase

    # Allow necessary parameters here:
    # allow_params :some_parameter, :another_one

    # Add case-specific validations
    # validates :some_attribute, presence: true

    def run!
      validate!
      # describe other rules here
    end

    private

    # Define custom validations
    # def something_valid?
    #   return unless something
    #   errors.add :some_attribute, :some_key
    # end

    # Define virtual attributes to validate
    # def some_attribute
    #   @some_attribute ||= params["some_param"]
    # end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
hexx-1.1.0 lib/generators/use_case/templates/use_case.erb
hexx-1.0.2 lib/generators/use_case/templates/use_case.erb
hexx-1.0.1 lib/generators/use_case/templates/use_case.erb
hexx-1.0.0 lib/generators/use_case/templates/use_case.erb
hexx-0.1.1 lib/generators/use_case/templates/use_case.erb
hexx-0.1.0 lib/generators/use_case/templates/use_case.erb