Class: SparkApi::Models::NewsFeedMeta
- Defined in:
- lib/spark_api/models/news_feed_meta.rb
Constant Summary
Constants included from Paginate
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
Attributes inherited from Base
Instance Method Summary collapse
- #core_field_names ⇒ Object
- #core_fields ⇒ Object
-
#initialize ⇒ NewsFeedMeta
constructor
A new instance of NewsFeedMeta.
- #minimum_core_fields ⇒ Object
Methods inherited from Base
#connection, connection, count, element_name, element_name=, first, get, #load, #method_missing, #parse_id, #path, path, #persisted?, prefix, prefix=, #resource_pluralized, #resource_uri, #respond_to?, #to_param, #to_partial_path
Methods included from Paginate
#collect, #paginate, #per_page
Methods included from Dirty
#changed, #changed?, #changed_attributes, #changes, #dirty_attributes, #previous_changes
Constructor Details
#initialize ⇒ NewsFeedMeta
Returns a new instance of NewsFeedMeta.
9 10 11 12 |
# File 'lib/spark_api/models/news_feed_meta.rb', line 9 def initialize super @data = connection.get(self.path).first end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class SparkApi::Models::Base
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
5 6 7 |
# File 'lib/spark_api/models/news_feed_meta.rb', line 5 def data @data end |
Instance Method Details
#core_field_names ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'lib/spark_api/models/news_feed_meta.rb', line 18 def core_field_names fields = @data['Subscriptions']['SavedSearches']['CoreSearchFields'] @data['Subscriptions']['SavedSearches']['CoreStandardFields'].each do |field| fields << field[1]['Label'] end fields end |
#core_fields ⇒ Object
28 29 30 31 32 33 34 35 36 |
# File 'lib/spark_api/models/news_feed_meta.rb', line 28 def core_fields fields = @data['Subscriptions']['SavedSearches']['CoreSearchFields'] @data['Subscriptions']['SavedSearches']['CoreStandardFields'].each do |field| fields << field.first end fields end |
#minimum_core_fields ⇒ Object
14 15 16 |
# File 'lib/spark_api/models/news_feed_meta.rb', line 14 def minimum_core_fields @data['Subscriptions']['SavedSearches']['MinimumCoreFields'] end |