Sha256: 69d0d532848474e717874ccac11bffbb8a25d63330a2c8233d7e161a54212c54
Contents?: true
Size: 376 Bytes
Versions: 1
Compression:
Stored size: 376 Bytes
Contents
# frozen_string_literal: true require 'optparse' module LovelyRufus Settings = Struct.new(:width) do def initialize(args) self.width = 72 OptionParser.new(&method(:parse)).parse! args end private def parse(opts) opts.on('-w', '--width=WIDTH', Integer, 'Wrapping width') do |width| self.width = width end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
lovely_rufus-1.0.1 | lib/lovely_rufus/settings.rb |