Sha256: 700ce183cad1677a498ff9e873ac648e123eb00d9847bbbfd6ca1a65cb2c5741

Contents?: true

Size: 719 Bytes

Versions: 13

Compression:

Stored size: 719 Bytes

Contents

# frozen_string_literal: true

require_relative 'args'

# Config for saved files.
class SavedConfig
  attr_reader :token, :owner, :repo, :branch, :regex, :author_name, :author_email

  def initialize(hash)
    @token = Args.fetch_non_empty_string(hash, :token).strip
    @owner = Args.fetch_non_empty_string(hash, :owner).strip
    @repo = Args.fetch_non_empty_string(hash, :repo).strip
    @branch = Args.fetch_non_empty_string(hash, :branch).strip
    @regex = Regexp.new(Args.fetch_non_empty_string(hash, :regex))
    author = Args.fetch_non_empty_hash(hash, :author)
    @author_name = Args.fetch_non_empty_string(author, :name).strip
    @author_email = Args.fetch_non_empty_string(author, :email).strip
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
sqlui-0.1.84 app/saved_config.rb
sqlui-0.1.83 app/saved_config.rb
sqlui-0.1.82 app/saved_config.rb
sqlui-0.1.81 app/saved_config.rb
sqlui-0.1.80 app/saved_config.rb
sqlui-0.1.79 app/saved_config.rb
sqlui-0.1.78 app/saved_config.rb
sqlui-0.1.77 app/saved_config.rb
sqlui-0.1.76 app/saved_config.rb
sqlui-0.1.75 app/saved_config.rb
sqlui-0.1.74 app/saved_config.rb
sqlui-0.1.73 app/saved_config.rb
sqlui-0.1.72 app/saved_config.rb