Sha256: caf6662b3c02dcc4f993c87af1635b92370b6a64c3e778c566df146081e64054

Contents?: true

Size: 773 Bytes

Versions: 3

Compression:

Stored size: 773 Bytes

Contents

# frozen_string_literal: true

# Copyright (c) 2019 Valencia Management Group
# All rights reserved.

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

3 entries across 3 versions & 1 rubygems

Version Path
tops_connect-0.7.2 lib/tops_connect/community.rb
tops_connect-0.7.1 lib/tops_connect/community.rb
tops_connect-0.7.0 lib/tops_connect/community.rb