Class: Octoparts::Representer::Camelizer

Inherits:
Object
  • Object
show all
Includes:
Uber::Callable
Defined in:
lib/octoparts/representer/aggregate_request_representer.rb

Instance Method Summary collapse

Constructor Details

#initialize(camelcase) ⇒ Camelizer

Returns a new instance of Camelizer.



7
8
9
# File 'lib/octoparts/representer/aggregate_request_representer.rb', line 7

def initialize(camelcase)
  @camelcase = camelcase
end

Instance Method Details

#call(represented) ⇒ Object



11
12
13
14
15
# File 'lib/octoparts/representer/aggregate_request_representer.rb', line 11

def call(represented)
  options = represented.fetch(:options, {})
  user_options = options.fetch(:user_options, {})
  user_options[:camelize] ? @camelcase : @camelcase.underscore
end