Class: Foobara::CommandConnectors::Serializer

Inherits:
Value::Transformer show all
Defined in:
foobara-0.0.122/projects/command_connectors/src/serializer.rb

Instance Attribute Summary

Attributes inherited from Value::Processor

#created_in_namespace, #declaration_data, #parent_declaration_data

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Value::Transformer

create, error_classes, foobara_manifest, #process_value, subclass

Methods inherited from Value::Processor

#always_applicable?, #applicable?, #attribute_name, #build_error, default_declaration_data, #dup_processor, error_class, error_classes, #error_context, #error_message, #error_path, foobara_manifest, #foobara_manifest, #inspect, instance, #method_missing, #name, new_with_agnostic_args, #possible_errors, #priority, #process_outcome, #process_outcome!, #process_value, #process_value!, processor_name, requires_declaration_data?, requires_parent_declaration_data?, #respond_to_missing?, #runner, symbol

Methods included from IsManifestable

#foobara_domain, #foobara_manifest, #foobara_organization, #scoped_clear_caches

Methods included from Foobara::Concern

foobara_class_methods_module_for, foobara_concern?, included

Constructor Details

#initialize(declaration_data = {}) ⇒ Serializer

Returns a new instance of Serializer.

[View source]

20
21
22
# File 'foobara-0.0.122/projects/command_connectors/src/serializer.rb', line 20

def initialize(declaration_data = {})
  super
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Foobara::Value::Processor

Class Method Details

.serializer_from_symbol(symbol) ⇒ Object

[View source]

5
6
7
8
9
10
11
12
13
# File 'foobara-0.0.122/projects/command_connectors/src/serializer.rb', line 5

def serializer_from_symbol(symbol)
  Util.descendants(Serializer).find do |klass|
    name = Util.non_full_name(klass)
    name = name.gsub(/Serializer$/, "")
    name = Util.underscore(name)

    symbol.to_s == name
  end
end

Instance Method Details

#requestObject

[View source]

16
17
18
# File 'foobara-0.0.122/projects/command_connectors/src/serializer.rb', line 16

def request
  declaration_data
end

#transform(object) ⇒ Object

[View source]

24
25
26
# File 'foobara-0.0.122/projects/command_connectors/src/serializer.rb', line 24

def transform(object)
  serialize(object)
end