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

Change collection getter parameter type to AbstractCollection #3

Merged
merged 1 commit into from
Sep 2, 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: 6 additions & 6 deletions src/macros.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ function getters_field(; name::Symbol, name_snakecase::Symbol, function_name::Sy

description = "Get the $field_name field from the $name collection."

doc_string = build_doc_string("$function_name($name_snakecase::$name)", description)
doc_string = build_doc_string("$function_name($name_snakecase::AbstractCollection)", description)
push!(getters, quote
@doc $doc_string function $function_name($name_snakecase::$name)
@doc $doc_string function $function_name($name_snakecase::AbstractCollection)
return raw_data($name_snakecase.$field_name)
end
end)
Expand All @@ -40,9 +40,9 @@ function getters_callable(; name::Symbol, name_snakecase::Symbol, function_name:

description = "Get the $field_name field from the $name collection."

doc_string = build_doc_string("$function_name($name_snakecase::$name)", description)
doc_string = build_doc_string("$function_name($name_snakecase::AbstractCollection)", description)
push!(getters, quote
@doc $doc_string function $function_name($name_snakecase::$name)
@doc $doc_string function $function_name($name_snakecase::AbstractCollection)
return $name_snakecase.$field_name()
end
end)
Expand All @@ -69,9 +69,9 @@ function getters_array1(; name::Symbol, name_snakecase::Symbol, function_name::S

description = "Get the $field_name field from the $name collection at index i."

doc_string = build_doc_string("$function_name($name_snakecase::$name, i::Integer)", description)
doc_string = build_doc_string("$function_name($name_snakecase::AbstractCollection, i::Integer)", description)
push!(getters, quote
@doc $doc_string function $function_name($name_snakecase::$name, i::Integer)
@doc $doc_string function $function_name($name_snakecase::AbstractCollection, i::Integer)
return $name_snakecase.$field_name[i]
end
end)
Expand Down