Skip to content

Commit

Permalink
feat (Builders): Renames set/remove attributes
Browse files Browse the repository at this point in the history
This is to match up with the names for the internal collection.
  • Loading branch information
jamiepollock committed Jan 16, 2024
1 parent 5bd1d02 commit 61c574f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
8 changes: 3 additions & 5 deletions src/Rhythm.Drop.Builders/Links/IHtmlAttributesLinkBuilder.cs
Original file line number Diff line number Diff line change
@@ -1,25 +1,23 @@
namespace Rhythm.Drop.Builders.Links;

using Rhythm.Drop.Models.Common.Attributes;

/// <summary>
/// A contract for creating a link builder which modifies attributes.
/// </summary>
/// <typeparam name="TBuilder">The type of the builder to return after modifying HTML attributes.</typeparam>
public interface IHtmlAttributesLinkBuilder<TBuilder>
{
/// <summary>
/// Adds an attribute to the current builder.
/// Sets an attribute to the current builder.
/// </summary>
/// <param name="name">The name of the attribute.</param>
/// <param name="value">The value of the attribute.</param>
/// <returns>A <typeparamref name="TBuilder"/>.</returns>
TBuilder IncludeAttribute(string name, object? value);
TBuilder SetAttribute(string name, object? value);

/// <summary>
/// Removes an attribute from the current builder.
/// </summary>
/// <param name="name">The name of the attribute.</param>
/// <returns>A <typeparamref name="TBuilder"/>.</returns>
TBuilder ExcludeAttribute(string name);
TBuilder RemoveAttribute(string name);
}
4 changes: 2 additions & 2 deletions src/Rhythm.Drop.Builders/Links/Modals/ModalLinkBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@ public IModalAndLabelLinkBuilder AndLabel(string? label)
}

/// <inheritdoc/>
public IModalAndLabelLinkBuilder ExcludeAttribute(string name)
public IModalAndLabelLinkBuilder RemoveAttribute(string name)
{
_attributes.RemoveAttribute(name);
return this;
}

/// <inheritdoc/>
public IModalAndLabelLinkBuilder IncludeAttribute(string name, object? value)
public IModalAndLabelLinkBuilder SetAttribute(string name, object? value)
{
_attributes.SetAttribute(name, value);
return this;
Expand Down
4 changes: 2 additions & 2 deletions src/Rhythm.Drop.Builders/Links/Url/UrlLinkBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ public IUrlAndLabelLinkBuilder AndLabel(string? label)
}

/// <inheritdoc/>
public IUrlAndLabelLinkBuilder ExcludeAttribute(string name)
public IUrlAndLabelLinkBuilder RemoveAttribute(string name)
{
_attributes.RemoveAttribute(name);
return this;
}

/// <inheritdoc/>
public IUrlAndLabelLinkBuilder IncludeAttribute(string name, object? value)
public IUrlAndLabelLinkBuilder SetAttribute(string name, object? value)
{
_attributes.SetAttribute(name, value);
return this;
Expand Down

0 comments on commit 61c574f

Please sign in to comment.