Sha256: 5b3f126f5ac9f5964ba317256608dc6b6f9ae0016dbf6f244bd9aee4a723010e

Contents?: true

Size: 552 Bytes

Versions: 10

Compression:

Stored size: 552 Bytes

Contents

module Contracts
  module Attrs
    def attr_reader_with_contract(*names, contract)
      names.each do |name|
        Contract Contracts::None => contract
        attr_reader(name)
      end
    end

    def attr_writer_with_contract(*names, contract)
      names.each do |name|
        Contract contract => contract
        attr_writer(name)
      end
    end

    def attr_accessor_with_contract(*names, contract)
      attr_reader_with_contract(*names, contract)
      attr_writer_with_contract(*names, contract)
    end
  end

  include Attrs
end

Version data entries

10 entries across 10 versions & 3 rubygems

Version Path
entitlements-app-1.1.0 lib/contracts-ruby2/lib/contracts/attrs.rb
entitlements-app-1.0.0 lib/contracts-ruby2/lib/contracts/attrs.rb
entitlements-app-0.3.4 lib/contracts-ruby2/lib/contracts/attrs.rb
entitlements-app-0.3.1 lib/contracts-ruby2/lib/contracts/attrs.rb
entitlements-app-0.3.0 lib/contracts-ruby2/lib/contracts/attrs.rb
entitlements-0.2.1 lib/contracts-ruby2/lib/contracts/attrs.rb
entitlements-app-0.2.1 lib/contracts-ruby2/lib/contracts/attrs.rb
entitlements-0.2.0 lib/contracts-ruby2/lib/contracts/attrs.rb
entitlements-app-0.2.0 lib/contracts-ruby2/lib/contracts/attrs.rb
contracts-0.16.1 lib/contracts/attrs.rb