Sounds good. Fire away.



From: Aaron Christy <notifications@github.com<mailto:notifications@github.com>>
Reply-To: forever-inc/netsweet <reply@reply.github.com<mailto:reply@reply.github.com>>
Date: Thursday, December 19, 2013 at 10:17 AM
To: forever-inc/netsweet <netsweet@noreply.github.com<mailto:netsweet@noreply.github.com>>
Cc: David Watson <dwatson@forever.com<mailto:dwatson@forever.com>>
Subject: Re: [netsweet] [#61296250] Convert from SOAP to REST (#4)


In lib/netsweet/customer.rb:

>
>  module Netsweet
>    class Customer
> -    extend Forwardable
> -    def_delegators :@rvp_customer, :access_role, :external_id,
> -                   :internal_id, :email, :delete
> +    extend Translator
> +
> +    attr_accessor :properties
> +
> +    translate :properties do
> +      {
> +        first_name:   :firstname,
> +        last_name:    :lastname,
> +        email:        :email,
> +        internal_id:  :id,
> +        external_id:  [:externalid,  ->(v) { v[:internalid] }, ->(v) { { internalid: v } }],


The fact that the value of that hash has no descriptors is probably a general point of confusion. There might be some way to better define them and still make it usable, but I'd need to think about it some more.

How about if I add those detailed comments you mentioned to the translator module and then a simpler comment on the Customer model? If the Netsweet gem sticks around, the translator module was designed so that it could be included on any of the other models that might need to do similar work. So, it might make sense to keep any detailed comments on the Translator module itself.

—
Reply to this email directly or view it on GitHub<https://github.com/forever-inc/netsweet/pull/4/files#r8471698>.