Class: RestEasy::Conventions::SnakeCase

Inherits:
Object
  • Object
show all
Defined in:
lib/rest_easy/conventions.rb

Instance Method Summary collapse

Instance Method Details

#parse(api_name) ⇒ Object



42
43
44
45
# File 'lib/rest_easy/conventions.rb', line 42

def parse(api_name)
  # "document_number" → :document_number
  api_name.to_s.to_sym
end

#serialise(model_name) ⇒ Object



47
48
49
50
# File 'lib/rest_easy/conventions.rb', line 47

def serialise(model_name)
  # :document_number → "document_number"
  model_name.to_s
end