lib/chatterbot/config.rb
#
# generate a set of methods to manage checks around the
# assortment of since_id values we use to track most recent data
# retrieve from twitter
#
# @param [Symbol] key the key for the variable
generate a set of methods to manage checks around the
assortment of since_id values we use to track most recent data
retrieve from twitter
generate a set of methods to manage checks around the assortment of since_id values we use to track most recent data retrieve from twitter
def attr_since_id(key = nil)
        attr_name = key.nil? ? "since_id" : ["since_id", key.to_s].join("_")
			  class_eval <<-EVAL
          def #{attr_name}=(x)
            config[:#{attr_name}] = x
          end
          def #{attr_name}
            config[:#{attr_name}] || 1
          end
          def update_#{attr_name}(input)
            max = max_id_from(input)
            config[:#{attr_name}] = [config[:#{attr_name}].to_i, max.to_i].max
          end
        EVAL
      end
def attr_since_id ( key = nil ) attr_name = key . nil? ? "since_id" : [ "since_id" , key . to_s ] . join ( "_" ) class_eval <<-EVAL 
          def  #{ attr_name } =(x)
            config[: #{ attr_name } ] = x
          end
          def  #{ attr_name } 
            config[: #{ attr_name } ] || 1
          end

          def update_ #{ attr_name } (input)
            max = max_id_from(input)
            config[: #{ attr_name } ] = [config[: #{ attr_name } ].to_i, max.to_i].max
          end
         EVAL end
generate a set of methods to manage checks around the
assortment of since_id values we use to track most recent data
retrieve from twitter
generate a set of methods to manage checks around the assortment of since_id values we use to track most recent data retrieve from twitter
key
<not_specific>
<not_specific>
key the key for the variable
key the key for the variable