Sha256: 77e01986bcdbe002d685ce2c25024d657c08364aee6d7e7d6b369d6efb8f868d

Contents?: true

Size: 457 Bytes

Versions: 1

Compression:

Stored size: 457 Bytes

Contents

class <%= klass %> < Tram::Policy
<% parsed_params.each do |param| -%>
  param :<%= param %>
<% end -%>
<% parsed_options.each do |option| -%>
  option :<%= option %>
<% end -%>

<% parsed_validators.each do |validator| -%>
  validate :<%= validator %>
<% end -%>

  private
<% parsed_validators.each do |validator| %>
  def <%= validator %>
    return if true # define a condition
    errors.add :<%= validator %> # add necessary tags
  end
<% end -%>
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tram-policy-0.0.1 lib/tram/policy/generator/policy.erb