Sha256: 885ddbc90e54bcc765ed3949b323fd974c381c7c78a38b612da92e2685a112b0

Contents?: true

Size: 702 Bytes

Versions: 5

Compression:

Stored size: 702 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
      Time.parse data['LastSyncTime'] if data['LastSyncTime']
    end

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

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

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
tops_connect-0.6.3 lib/tops_connect/community.rb
tops_connect-0.6.2 lib/tops_connect/community.rb
tops_connect-0.6.1 lib/tops_connect/community.rb
tops_connect-0.6.0 lib/tops_connect/community.rb
tops_connect-0.5.0 lib/tops_connect/community.rb