Sha256: 9f2e6032e83fad739d6a106f789a4ce87cef2ab160a6cb116e8847d2791d827e

Contents?: true

Size: 709 Bytes

Versions: 10

Compression:

Stored size: 709 Bytes

Contents

# frozen_string_literal: true
module TopsConnect
  class Community < Base
    def community_key
      data['CommunityKey']
    end
    alias id community_key

    def community_id
      data['CommunityID']
    end
    alias code community_id

    def name
      data['Name']
    end

    def city
      data['DefaultCity']
    end

    def state
      data['DefaultState']
    end

    def zip
      data['DefaultZip']
    end

    def last_synced_at
      DateTime.parse data['LastSyncTime'] if data['LastSyncTime']
    end

    def modified_date
      return unless data['Metadata']['ModifiedDate']

      DateTime.parse data['Metadata']['ModifiedDate']
    end
    alias updated_at modified_date
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
tops_connect-0.4.3.2 lib/tops_connect/community.rb
tops_connect-0.4.3.1 lib/tops_connect/community.rb
tops_connect-0.4.3 lib/tops_connect/community.rb
tops_connect-0.4.2.1 lib/tops_connect/community.rb
tops_connect-0.4.2 lib/tops_connect/community.rb
tops_connect-0.4.1 lib/tops_connect/community.rb
tops_connect-0.4.0 lib/tops_connect/community.rb
tops_connect-0.3.4 lib/tops_connect/community.rb
tops_connect-0.3.3 lib/tops_connect/community.rb
tops_connect-0.3.2 lib/tops_connect/community.rb