Class: Worklog::Configuration::ProjectConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/configuration.rb

Overview

Configuration for projects

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ ProjectConfig

Initialize with default values, parameters can be overridden via hash

Examples:

ProjectConfig.new({'show_last' => 5})


47
48
49
50
51
52
53
# File 'lib/configuration.rb', line 47

def initialize(params = {})
  return if params.nil?

  params.each do |key, value|
    instance_variable_set("@#{key}", value) if respond_to?("#{key}=")
  end
end

Instance Attribute Details

#show_lastInteger

Returns Number of last projects to show in the project list.

Returns:

  • (Integer)

    Number of last projects to show in the project list.



41
42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/configuration.rb', line 41

class ProjectConfig
  attr_accessor :show_last

  # Initialize with default values, parameters can be overridden via hash
  # @example
  #   ProjectConfig.new({'show_last' => 5})
  def initialize(params = {})
    return if params.nil?

    params.each do |key, value|
      instance_variable_set("@#{key}", value) if respond_to?("#{key}=")
    end
  end
end