lib/basecampeverest/convert.rb
def convert_to_ostruct_recursive(obj, options)
      result = obj
      if result.is_a? Hash
        result = result.dup.with_sym_keys
        result.each  do |key, val| 
          result[key] = convert_to_ostruct_recursive(val, options) unless options[:exclude].try(:include?, key)
        end
        result = OpenStruct.new result       
      elsif result.is_a? Array
         result = result.map { |r| convert_to_ostruct_recursive(r, options) }
      end
      return result
    end
# convert an array into a nested OpenStruct
# 
# @param [Basecampeverest::Project] object the recursive object to pass in
# @return [Basecampeverest::Project] the found project information from the Basecamp API
convert an array into a nested OpenStruct
convert an array into a nested OpenStruct
def convert_to_ostruct_recursive(obj, options)
      result = obj
      if result.is_a? Hash
        result = result.dup.with_sym_keys
        result.each  do |key, val| 
          result[key] = convert_to_ostruct_recursive(val, options) unless options[:exclude].try(:include?, key)
        end
        result = OpenStruct.new result       
      elsif result.is_a? Array
         result = result.map { |r| convert_to_ostruct_recursive(r, options) }
      end
      return result
    end
def convert_to_ostruct_recursive ( obj , options ) result = obj if result . is_a? Hash result = result . dup . with_sym_keys result . each do | key , val | result [ key ] = convert_to_ostruct_recursive ( val , options ) unless options [ :exclude ] . try ( :include? , key ) end result = OpenStruct . new result elsif result . is_a? Array result = result . map { | r | convert_to_ostruct_recursive ( r , options ) } end return result end
convert an array into a nested OpenStruct
convert an array into a nested OpenStruct
the found project information from the Basecamp API
the found project information from the Basecamp API
Basecampeverest::Project
obj
options
object the recursive object to pass in
object the recursive object to pass in