Class: Slackware::ChangeLog::Update

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

Overview

A changeset, which should consist of entries of changes and/or notes regarding the updates

Instance Method Summary collapse

Constructor Details

#initialize(date = nil, notes = "", entries = Array.new, changelog = nil) ⇒ Update

FIXME this class needs more proper value setting



68
69
70
71
72
73
74
75
76
# File 'lib/slackware/changelog.rb', line 68

def initialize(date = nil,
               notes = "",
               entries = Array.new,
               changelog = nil )
  @date = date
  @notes = notes
  @entries = entries
  @changelog = changelog
end

Instance Method Details

#changelog=(changelog) ⇒ Object



93
# File 'lib/slackware/changelog.rb', line 93

def changelog=(changelog); @changelog = changelog if changelog.is_a?(Slackware::ChangeLog); end

#dateObject



77
# File 'lib/slackware/changelog.rb', line 77

def date; @date; end

#date=(timestamp) ⇒ Object



83
84
85
86
87
88
89
90
91
# File 'lib/slackware/changelog.rb', line 83

def date=(timestamp)
  if (timestamp.is_a?(Time))
    @date = timestamp
  elsif (timestamp.is_a?(Date))
    @date = timestamp.to_time
  else
    @date = Time.parse(timestamp)
  end
end

#entriesObject



79
# File 'lib/slackware/changelog.rb', line 79

def entries; @entries; end

#notesObject



78
# File 'lib/slackware/changelog.rb', line 78

def notes; @notes; end

#notes=(text) ⇒ Object



92
# File 'lib/slackware/changelog.rb', line 92

def notes=(text); @notes = text; end

#securityObject



80
# File 'lib/slackware/changelog.rb', line 80

def security; @entries.select {|e| e if e.security }; end

#security?Boolean

Returns:

  • (Boolean)


81
# File 'lib/slackware/changelog.rb', line 81

def security?; @entries.select {|e| e.security }.first; end