Class: Hubspot::Blogs::BlogAssociation

Inherits:
Hubspot::Base
  • Object
show all
Defined in:
app/models/hubspot/blogs/blog_association.rb

Overview

Define an assocation base class from which blog child associations should inherit

Direct Known Subclasses

Comment, Post

Class Method Summary collapse

Methods inherited from Hubspot::Base

connection, #to_json

Class Method Details

.collection_path(prefix_options = {}, query_options = nil) ⇒ Object

Raises:

  • (ActiveResource::MissingPrefixParam)


16
17
18
19
20
# File 'app/models/hubspot/blogs/blog_association.rb', line 16

def collection_path(prefix_options = {}, query_options = nil)
  prefix_options, query_options = split_options(prefix_options) if query_options.nil?
  raise(ActiveResource::MissingPrefixParam, ":blog_guid prefix_option is missing") unless prefix_options[:blog_guid] && defined?(ActiveResource::MissingPrefixParam)
  "#{prefix(prefix_options)}#{prefix_options[:blog_guid].to_s}/#{collection_name}.#{format.extension}#{query_string(query_options)}"
end

.element_path(id, prefix_options = {}, query_options = nil) ⇒ Object



11
12
13
14
# File 'app/models/hubspot/blogs/blog_association.rb', line 11

def element_path(id, prefix_options = {}, query_options = nil)
  prefix_options, query_options = split_options(prefix_options) if query_options.nil?
  "#{prefix(prefix_options)}#{collection_name}/#{URI.escape id.to_s}.#{format.extension}#{query_string(query_options)}"
end