module Contracts::Attrs

Public Instance Methods

attr_accessor_with_contract(*names, contract) click to toggle source
# File lib/contracts/attrs.rb, line 19
def attr_accessor_with_contract(*names, contract)
  attr_reader_with_contract(*names, contract)
  attr_writer_with_contract(*names, contract)
end
attr_reader_with_contract(*names, contract) click to toggle source
# File lib/contracts/attrs.rb, line 5
def attr_reader_with_contract(*names, contract)
  names.each do |name|
    Contract Contracts::None => contract
    attr_reader(name)
  end
end
attr_writer_with_contract(*names, contract) click to toggle source
# File lib/contracts/attrs.rb, line 12
def attr_writer_with_contract(*names, contract)
  names.each do |name|
    Contract contract => contract
    attr_writer(name)
  end
end