Skip to content

Commit

Permalink
Literal::Array#append
Browse files Browse the repository at this point in the history
While we're here, let's add the `#append` method alias.
  • Loading branch information
phillipspc committed Nov 11, 2024
1 parent fbd5c57 commit 3d2b24f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/literal/array.rb
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ def push(*value)
self
end

alias_method :append, :push

def unshift(value)
Literal.check(actual: value, expected: @__type__) do |c|
c.fill_receiver(receiver: self, method: "#unshift")
Expand Down

0 comments on commit 3d2b24f

Please sign in to comment.