lib/quickbooks/model.rb
# Register multiple read/writable properties at once. For example:
#   read_write :first_name, :last_name, :phone, :alt_phone
# For reference attributes (like parent_ref), use ParentRef - a class constant for that object.
# _read_write_ will set the property setter and accessor accordingly.
Register multiple read/writable properties at once.
Register multiple read / writable properties at once .
def read_write(*args)
        if args.empty?
          @read_write || (@read_write = [])
        else
          args.each do |prop|
            if prop.is_a?(Symbol)
              read_write << prop
              attr_accessor prop
            else
              @object_properties[prop.class_leaf_name.underscore.to_sym] = prop
              read_write << prop.class_leaf_name.underscore.to_sym
              class_eval "def #{prop.class_leaf_name.underscore}=(v); @#{prop.class_leaf_name.underscore} = #{prop.name}.new(v); end
                def #{prop.class_leaf_name.underscore}; @#{prop.class_leaf_name.underscore}; end"
            end
          end
        end
      end
def read_write ( * args ) if args . empty? @read_write || ( @read_write = [ ] ) else args . each do | prop | if prop . is_a? ( Symbol ) read_write << prop attr_accessor prop else @object_properties [ prop . class_leaf_name . underscore . to_sym ] = prop read_write << prop . class_leaf_name . underscore . to_sym class_eval "def #{prop.class_leaf_name.underscore}=(v); @#{prop.class_leaf_name.underscore} = #{prop.name}.new(v); end
                def #{prop.class_leaf_name.underscore}; @#{prop.class_leaf_name.underscore}; end" end end end end
Register multiple read/writable properties at once.
Register multiple read / writable properties at once .
args
<not_specific>