Class: RailsApiDoc::Model::AttributeParser

Inherits:
Object
  • Object
show all
Defined in:
lib/rails_api_doc/model/attribute_parser.rb

Overview

author: Vadim Shaveiko <@vshaveyko> :nodoc:

Constant Summary collapse

WRONG_NAME_ERROR_STRING =

TODO : Change to I18n. Added on: 08.10.16. Added by: <@vshaveyko>

'Name should consist only of letters\cciphers\underscores'
WRONG_TYPE_ERROR_STRING =
'Wrong type saved'

Class Method Summary collapse

Class Method Details

.parse_attributes(params) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/rails_api_doc/model/attribute_parser.rb', line 12

def parse_attributes(params)
  {
    name: parse_name(params[:name]),
    type: parse_type(params[:type]),
    desc: params[:desc],
    special: parse_special(params[:type], params[:special]),
    action_type: params[:action],
    nesting: params[:nesting],
    api_type: params[:api_type],
    api_action: params[:api_action],
    id: params[:id]
  }.compact
end