Sha256: e92178becc2898d95d86a7882db1d1be85952f4e9eba227607a5e05b2f198d18

Contents?: true

Size: 563 Bytes

Versions: 1

Compression:

Stored size: 563 Bytes

Contents

require 'active_model'

module EipValidator
  class Validator
    include ActiveModel::Model
    attr_accessor :eip, :title, :author, :type, :category, :status, :created
    attr_accessor :replaces, :requires, :layer
    validates_presence_of :eip, :title, :author, :type, :status, :created
    validates_inclusion_of :category,
                           in: %w(Core Networking Interface ERC),
                           if: Proc.new { |v| v.type == 'Standards Track' }

    validates_inclusion_of :status, in: %w(Draft Active Accepted Final Deferred)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
eip_validator-0.5.0 lib/eip_validator/validator.rb