Module: ChoronSupport::AsProps
- Defined in:
- lib/choron_support/as_props.rb
Defined Under Namespace
Classes: NameError
Instance Method Summary collapse
Instance Method Details
#as_props(type_symbol = nil, **params) ⇒ Hash
16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/choron_support/as_props.rb', line 16 def as_props(type_symbol = nil, **params) pass_params = params.except(:camel, :sti) serializer = __get_props_class(type_symbol, pass_params, sti: params[:sti]) skip_camel = (params[:camel] == false) if serializer.nil? skip_camel ? as_json : as_json.as_camel else skip_camel ? serializer.as_props : serializer.as_props.as_camel end end |