Class: Brute::Changelog::Release

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

Overview

One ## [...] section of the file.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#dateObject

Returns the value of attribute date

Returns:

  • (Object)

    the current value of date



51
52
53
# File 'lib/brute/changelog.rb', line 51

def date
  @date
end

#lineObject

Returns the value of attribute line

Returns:

  • (Object)

    the current value of line



51
52
53
# File 'lib/brute/changelog.rb', line 51

def line
  @line
end

#subsectionsObject

Returns the value of attribute subsections

Returns:

  • (Object)

    the current value of subsections



51
52
53
# File 'lib/brute/changelog.rb', line 51

def subsections
  @subsections
end

#versionObject

Returns the value of attribute version

Returns:

  • (Object)

    the current value of version



51
52
53
# File 'lib/brute/changelog.rb', line 51

def version
  @version
end

Instance Method Details

#empty?Boolean

Returns:

  • (Boolean)


53
# File 'lib/brute/changelog.rb', line 53

def empty? = subsections.empty? || subsections.values.all?(&:empty?)

#to_sObject



54
# File 'lib/brute/changelog.rb', line 54

def to_s = unreleased? ? "[#{version}]" : "[#{version}] - #{date}"

#unreleased?Boolean

Returns:

  • (Boolean)


52
# File 'lib/brute/changelog.rb', line 52

def unreleased? = version == UNRELEASED