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

Serializer context #80

Merged
merged 12 commits into from
Feb 28, 2018
Merged

Serializer context #80

merged 12 commits into from
Feb 28, 2018

Conversation

nesaulov
Copy link
Owner

@nesaulov nesaulov commented Feb 22, 2018

#67
Added .serializer_context class method for Surrealist::Serializer and alias .serializer_contexts

array.each { |method| define_method(method) { context[method] } }
end

# Plural form ¯\_(ツ)_/¯

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use only ascii symbols in comments.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope

@nesaulov nesaulov changed the title [WIP] Serializer context Serializer context Feb 27, 2018
#
# @raise ArgumentError if type of argument is not an array of symbols
def serializer_context(*array)
unless array.reject(&-> (i) { i.is_a?(Symbol) }).empty?
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

syntax looks kind of crazy here, can we make this more readable?

unless array.all? { |i| i.is_a? Symbol }

Copy link
Collaborator

@AlessandroMinali AlessandroMinali left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine to me. Very interesting uses of prepend within the specs, I have not seen this keyword used much before

@nesaulov nesaulov merged commit 935ee04 into master Feb 28, 2018
@nesaulov nesaulov deleted the serializer-context branch February 28, 2018 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants