Sha256: e2abd985d6535efc4b008818065e2930e9b6e1c997617973c698f820e2e2e4b4

Contents?: true

Size: 846 Bytes

Versions: 1

Compression:

Stored size: 846 Bytes

Contents

module SparkApi
  module Models
    class NewsFeedMeta < Base

      self.element_name = "newsfeeds/meta"

      def minimum_core_fields
        data['Subscriptions']['SavedSearches']['MinimumCoreFields']
      end

      def core_field_names
        fields = data['Subscriptions']['SavedSearches']['CoreSearchFields']

        data['Subscriptions']['SavedSearches']['CoreStandardFields'].each do |field|
          fields << field[1]['Label']
        end

        fields
      end

      def core_fields
        fields = data['Subscriptions']['SavedSearches']['CoreSearchFields']

        data['Subscriptions']['SavedSearches']['CoreStandardFields'].each do |field|
          fields << field.first
        end

        fields
      end

      private

      def data
        @data ||= connection.get(self.path).first
      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
spark_api-1.4.0 lib/spark_api/models/news_feed_meta.rb