Sha256: 97b29ea7ea8a33371df9416edc0bd0f9b2a979bde7bad4d8918701e79123f4d1

Contents?: true

Size: 881 Bytes

Versions: 2

Compression:

Stored size: 881 Bytes

Contents

module SparkApi
  module Models
    class NewsFeedMeta < Base

      attr_accessor :data

      self.element_name = "newsfeeds/meta"

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

      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

    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
spark_api-1.3.28 lib/spark_api/models/news_feed_meta.rb
spark_api-1.3.27 lib/spark_api/models/news_feed_meta.rb