class PIM::DirectPublication
Public Class Methods
create(enabled = true, from: nil, to: nil)
click to toggle source
# File pim.rb, line 9693 def self.create enabled = true, from: nil, to: nil direct_publication = self.new enabled: enabled # Ensure from and to is either Regexp, String or Array of String if PIM::Utils.is_collection?(from) direct_publication.from_list = from.to_a.map { |v| v.to_s } elsif from.is_a?(Regexp) direct_publication.from_regexp = from.source else direct_publication.from = from.nil? ? nil : from.to_s end if PIM::Utils.is_collection?(to) direct_publication.to_list = to.to_a.map { |v| v.to_s } elsif to.is_a?(Regexp) direct_publication.to_regexp = to.source else direct_publication.to = to.nil? ? nil : to.to_s end direct_publication end
Public Instance Methods
as_json()
click to toggle source
# File pim.rb, line 9717 def as_json PIM::Utils.camelize(self.to_h.filter { |k,v| !v.nil? }) end
to_json(*args)
click to toggle source
# File pim.rb, line 9721 def to_json *args as_json.to_json(*args) end