Class: StandupMD::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/standup_md/config.rb,
lib/standup_md/config/cli.rb,
lib/standup_md/config/file.rb,
lib/standup_md/config/post.rb,
lib/standup_md/config/entry.rb

Overview

This class provides a connector from StandupMD to the configuration classes.

Defined Under Namespace

Classes: Cli, Entry, File, Post

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Builds the links to the configuration classes.



38
39
40
41
42
43
# File 'lib/standup_md/config.rb', line 38

def initialize
  @cli = StandupMD::Config::Cli.new
  @file = StandupMD::Config::File.new
  @entry = StandupMD::Config::Entry.new
  @post = StandupMD::Config::Post.new
end

Instance Attribute Details

#cliStandupMD::Config::Cli (readonly)

Reader for Cli config.



16
17
18
# File 'lib/standup_md/config.rb', line 16

def cli
  @cli
end

#entryStandupMD::Config::Entry (readonly)

Reader for Entry config.



28
29
30
# File 'lib/standup_md/config.rb', line 28

def entry
  @entry
end

#fileStandupMD::Config::File (readonly)

Reader for File config.



22
23
24
# File 'lib/standup_md/config.rb', line 22

def file
  @file
end

#postStandupMD::Config::Post (readonly)

Reader for Post config.



34
35
36
# File 'lib/standup_md/config.rb', line 34

def post
  @post
end

Instance Method Details

#copyStandupMD::Config

Builds an independent snapshot of the current configuration.

Returns:



49
50
51
52
53
54
55
56
# File 'lib/standup_md/config.rb', line 49

def copy
  self.class.new.tap do |config|
    config.cli.copy_from(cli)
    config.file.copy_from(file)
    config.entry.copy_from(entry)
    config.post.copy_from(post)
  end
end