Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable Comparison of Index Records #316

Merged
merged 2 commits into from
Jan 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions lib/fusuma/config/index.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,24 @@ def initialize(keys)
key = Key.new(key) if !key.is_a? Key
@keys << key
key.symbol
end.join(",")
end.join(",").to_sym
else
key = Key.new(keys)
@cache_key = key.symbol
@keys = [key]
end
end

def inspect
def to_s
@keys.map(&:inspect)
end

def ==(other)
return false unless other.is_a? Index

cache_key == other.cache_key
end

attr_reader :keys, :cache_key

# Keys in Index
Expand All @@ -40,7 +46,7 @@ def initialize(symbol_word, skippable: false)
@skippable = skippable
end

def inspect
def to_s
if @skippable
"#{@symbol}(skippable)"
else
Expand Down