Sha256: ecf2ae4d4f8c6d27d1994296161fabe0978a7c670accbbea873dcaefa689a6f1

Contents?: true

Size: 1.05 KB

Versions: 3

Compression:

Stored size: 1.05 KB

Contents

module NetSuiteRails
  module Configuration
    extend self

    NETSUITE_MAX_PAGE_SIZE = 1000

    def reset!
      attributes.clear
    end

    def attributes
      @attributes ||= {}
    end

    def netsuite_sync_mode(mode = nil)
      if mode.nil?
        attributes[:sync_mode] ||= :none
      else
        attributes[:sync_mode] = mode
      end
    end

    def netsuite_push_disabled(flag = nil)
      if flag.nil?
        attributes[:flag] ||= false
      else
        attributes[:flag] = flag
      end
    end

    def netsuite_pull_disabled(flag = nil)
      if flag.nil?
        attributes[:flag] ||= false
      else
        attributes[:flag] = flag
      end
    end

    def netsuite_instance_time_zone_offset(zone_offset = nil)
      if zone_offset.nil?
        attributes[:zone_offset] ||= -8
      else
        attributes[:zone_offset] = zone_offset
      end
    end

    def polling_page_size(size = nil)
      if size.nil?
        attributes[:size] ||= NETSUITE_MAX_PAGE_SIZE
      else
        attributes[:size] = size
      end
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
netsuite_rails-0.2.2 lib/netsuite_rails/configuration.rb
netsuite_rails-0.2.1 lib/netsuite_rails/configuration.rb
netsuite_rails-0.2.0 lib/netsuite_rails/configuration.rb