Class: Bake::Modernize::License::Authorship::Modification

Inherits:
Struct
  • Object
show all
Defined in:
lib/bake/modernize/license.rb

Overview

Represents a modification to a file.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#authorObject

Returns the value of attribute author

Returns:

  • (Object)

    the current value of author



175
176
177
# File 'lib/bake/modernize/license.rb', line 175

def author
  @author
end

#idObject

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



175
176
177
# File 'lib/bake/modernize/license.rb', line 175

def id
  @id
end

#pathObject

Returns the value of attribute path

Returns:

  • (Object)

    the current value of path



175
176
177
# File 'lib/bake/modernize/license.rb', line 175

def path
  @path
end

#timeObject

Returns the value of attribute time

Returns:

  • (Object)

    the current value of time



175
176
177
# File 'lib/bake/modernize/license.rb', line 175

def time
  @time
end

Instance Method Details

#full_nameObject

The full name of the author who made the modification.



178
179
180
# File 'lib/bake/modernize/license.rb', line 178

def full_name
	author[:name]
end

#keyObject

The stable key used to group modifications by commit or contribution.



184
185
186
# File 'lib/bake/modernize/license.rb', line 184

def key
	self.id || "#{self.author[:email]}:#{self.time.iso8601}"
end

#to_hObject

Convert the modification to a serializable hash.



190
191
192
193
194
195
196
197
# File 'lib/bake/modernize/license.rb', line 190

def to_h
	{
		id: id,
		time: time,
		path: path,
		author: author,
	}
end