Module: Alba::Serializer::ClassMethods
- Included in:
- Alba::Serializer
- Defined in:
- lib/alba/serializer.rb
Overview
Class methods
Instance Attribute Summary collapse
-
#_metadata ⇒ Object
readonly
Returns the value of attribute _metadata.
-
#_opts ⇒ Object
readonly
Returns the value of attribute _opts.
Instance Method Summary collapse
-
#metadata(name, &block) ⇒ Object
Set metadata.
-
#set(key: false) ⇒ Object
Set options, currently key only.
Instance Attribute Details
#_metadata ⇒ Object (readonly)
Returns the value of attribute _metadata.
53 54 55 |
# File 'lib/alba/serializer.rb', line 53 def @_metadata end |
#_opts ⇒ Object (readonly)
Returns the value of attribute _opts.
53 54 55 |
# File 'lib/alba/serializer.rb', line 53 def _opts @_opts end |
Instance Method Details
#metadata(name, &block) ⇒ Object
Set metadata
72 73 74 |
# File 'lib/alba/serializer.rb', line 72 def (name, &block) @_metadata[name.to_sym] = block end |
#set(key: false) ⇒ Object
Set options, currently key only
64 65 66 |
# File 'lib/alba/serializer.rb', line 64 def set(key: false) @_opts[:key] = key end |