class YARD::Serializers::Base
@abstract Override this class to implement a custom serializer.
* {#after_serialize}
* {#before_serialize}
Optionally, a serializer can implement before and after filters:
* {#serialized_path}
* {#serialize}
To implement a custom serializer, override the following methods:
would allow template contents to be written to the filesystem
rendered to various endpoints. For instance, a {FileSystemSerializer}
The abstract base serializer. Serializers allow templates to be
def after_serialize(data); end
-
(void)
-
Parameters:
-
data
(String
) -- the data that was serialized.
Other tags:
- Abstract: - Should run code after serialization.
def after_serialize(data); end
def before_serialize; end
-
(Boolean)
- whether or not serialization should occur
Other tags:
- Abstract: - Should run code before serialization. Should return false
def before_serialize; end
def exists?(object) # rubocop:disable Lint/UnusedMethodArgument
- Since: - 0.6.0
Returns:
-
(Boolean)
- whether the endpoint exists.
Parameters:
-
object
(CodeObjects::Base
) -- the object to check existence of
Other tags:
- Abstract: - This method should return whether the endpoint already exists.
def exists?(object) # rubocop:disable Lint/UnusedMethodArgument false end
def initialize(opts = {})
-
opts
(Hash
) -- the options to assign to {#options}
def initialize(opts = {}) @options = SymbolHash.new(false).update(opts) end
def serialize(object, data) end
-
data
(String
) -- the contents that should be serialized -
object
(CodeObjects::Base, String
) -- the object to serialize the
Other tags:
- Abstract: - This method should implement the logic that serializes
def serialize(object, data) end
def serialized_path(object) end
-
(String)
- the serialized path of an object
Parameters:
-
object
(CodeObjects::Base
) -- the object to return a path for
Other tags:
- Abstract: - This method should return the path of the object on the
def serialized_path(object) end