Created
September 26, 2018 06:52
-
-
Save Samsinite/504aadce1d88c6d6a411310fdfd5593e to your computer and use it in GitHub Desktop.
Ruby API Annotation DSL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class BazSerializer < BaseSerializer | |
attribtes :id, :thing, :bar | |
deprecated_attribute :old_thing | |
deprecation_flag: ::FeatureFlags::DEPRECATED_FEATURE_FOO, | |
upgrade_instructions: <<-INSTRUCTIONS | |
Replace `baz.old_thing` with `baz.thing` | |
INSTRUCTIONS | |
deprecated_belongs_to :foo | |
deprecation_flag: ::FeatureFlags::DEPRECATED_FEATURE_FOO, | |
upgrade_instructions: <<-INSTRUCTIONS | |
Replace `baz.foo.bar` with `baz.bar` | |
INSTRUCTIONS | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FooSerializer = DeprecatedSerializer.new do | |
deprecation_flag ::FeatureFlags::DEPRECATED_FEATURE_FOO | |
upgrade_instructions <<-INSTRUCTIONS | |
Replace Usage of `foo` with usage of `baz` | |
INSTRUCTIONS | |
attributes :id, :bar | |
has_one :baz | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment