module MarbleApiClient::Responses::BodyAttributes

Allows for declarative body attribute naming in response classes

Public Class Methods

included(klass) click to toggle source
# File lib/marble_api_client/responses/body_attributes.rb, line 15
def included(klass)
  klass.extend(ClassMethods)
end

Private Instance Methods

json_key(key) click to toggle source
# File lib/marble_api_client/responses/body_attributes.rb, line 33
def json_key(key)
  key.to_s.split('_').instance_eval do |k|
    [k.first] + k.drop(1).map(&:capitalize)
  end.join
end
parsed_body() click to toggle source
# File lib/marble_api_client/responses/body_attributes.rb, line 39
def parsed_body
  @parsed_body ||= JSON.parse(body)
end