Class: GemWatch::CommandOptions

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

Overview

Command options class for the command line interface. It is initialized with Defaults values.

Constant Summary collapse

Defaults =

Defaults values for command line interface.

{
  # SMTP Part
  :smtp_host  => 'localhost',
  :smtp_port  => 25,
  # Email part
  :email_recipients => [],
  :email_subject    => "GemWatch has found something to report",
  :email_from       => "[email protected]",
  # Checks part
  :check_update_on => :all,
  # General part
  :stdout => true
}

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeCommandOptions

Initialize a new object with Defaults values.



31
32
33
# File 'lib/gem_watch/command_options.rb', line 31

def initialize
  Defaults.each {|key, value| send "#{key}=", value}
end

Instance Attribute Details

#check_update_onObject

Returns the value of attribute check_update_on.



13
14
15
# File 'lib/gem_watch/command_options.rb', line 13

def check_update_on
  @check_update_on
end

#email_fromObject

Returns the value of attribute email_from.



10
11
12
# File 'lib/gem_watch/command_options.rb', line 10

def email_from
  @email_from
end

#email_recipientsObject

Returns the value of attribute email_recipients.



8
9
10
# File 'lib/gem_watch/command_options.rb', line 8

def email_recipients
  @email_recipients
end

#email_subjectObject

Returns the value of attribute email_subject.



9
10
11
# File 'lib/gem_watch/command_options.rb', line 9

def email_subject
  @email_subject
end

#smtp_hostObject

Returns the value of attribute smtp_host.



5
6
7
# File 'lib/gem_watch/command_options.rb', line 5

def smtp_host
  @smtp_host
end

#smtp_portObject

Returns the value of attribute smtp_port.



6
7
8
# File 'lib/gem_watch/command_options.rb', line 6

def smtp_port
  @smtp_port
end

#stdoutObject

Returns the value of attribute stdout.



12
13
14
# File 'lib/gem_watch/command_options.rb', line 12

def stdout
  @stdout
end