Class: Eco::API::Common::People::DefaultParsers::SelectParser

Inherits:
Loaders::Parser show all
Defined in:
lib/eco/api/common/people/default_parsers/select_parser.rb

Instance Attribute Summary

Attributes included from Language::AuxiliarLogger

#logger

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Loaders::Parser

active_when_all, active_when_any, #attribute, attribute, dependencies, #initialize, parsing_phase, serializing_phase

Methods inherited from Loaders::CaseBase

#name, name_only_once!, original_name

Methods inherited from Loaders::Base

<=>, created_at, #initialize, set_created_at!

Methods included from Language::Klass::InheritableClassVars

#inheritable_attrs, #inheritable_class_vars, #inherited

Methods included from Language::Klass::Naming

#instance_variable_name, #to_constant

Methods included from Language::Klass::Hierarchy

#descendants, #descendants?

Methods included from Language::Klass::Builder

#new_class

Methods included from Language::Klass::Uid

#uid

Methods included from Language::Klass::Resolver

#class_resolver, #resolve_class

Methods included from Language::Klass::Const

#if_const, #redef_without_warning

Methods included from Language::AuxiliarLogger

#log

Constructor Details

This class inherits a constructor from Eco::API::Common::Loaders::Parser

Class Method Details

.select_tablesObject



5
6
7
# File 'lib/eco/api/common/people/default_parsers/select_parser.rb', line 5

def select_tables
  @select_tables ||= {}
end

Instance Method Details

#parser(value, deps) ⇒ Object



15
16
17
18
# File 'lib/eco/api/common/people/default_parsers/select_parser.rb', line 15

def parser(value, deps)
  return value unless (options_map = options_hash(deps))
  to_select_option(value, options_map, attr: deps['attr'])
end

#serializer(value, _deps) ⇒ Object



20
21
22
# File 'lib/eco/api/common/people/default_parsers/select_parser.rb', line 20

def serializer(value, _deps)
  value
end