Class: PostProxy::PlatformParams

Inherits:
Model
  • Object
show all
Defined in:
lib/postproxy/types.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Model

#initialize

Constructor Details

This class inherits a constructor from PostProxy::Model

Instance Attribute Details

#blueskyObject

Returns the value of attribute bluesky.



611
612
613
# File 'lib/postproxy/types.rb', line 611

def bluesky
  @bluesky
end

#facebookObject

Returns the value of attribute facebook.



611
612
613
# File 'lib/postproxy/types.rb', line 611

def facebook
  @facebook
end

#google_businessObject

Returns the value of attribute google_business.



611
612
613
# File 'lib/postproxy/types.rb', line 611

def google_business
  @google_business
end

#instagramObject

Returns the value of attribute instagram.



611
612
613
# File 'lib/postproxy/types.rb', line 611

def instagram
  @instagram
end

#linkedinObject

Returns the value of attribute linkedin.



611
612
613
# File 'lib/postproxy/types.rb', line 611

def linkedin
  @linkedin
end

#pinterestObject

Returns the value of attribute pinterest.



611
612
613
# File 'lib/postproxy/types.rb', line 611

def pinterest
  @pinterest
end

#telegramObject

Returns the value of attribute telegram.



611
612
613
# File 'lib/postproxy/types.rb', line 611

def telegram
  @telegram
end

#threadsObject

Returns the value of attribute threads.



611
612
613
# File 'lib/postproxy/types.rb', line 611

def threads
  @threads
end

#tiktokObject

Returns the value of attribute tiktok.



611
612
613
# File 'lib/postproxy/types.rb', line 611

def tiktok
  @tiktok
end

#twitterObject

Returns the value of attribute twitter.



611
612
613
# File 'lib/postproxy/types.rb', line 611

def twitter
  @twitter
end

#youtubeObject

Returns the value of attribute youtube.



611
612
613
# File 'lib/postproxy/types.rb', line 611

def youtube
  @youtube
end

Instance Method Details

#to_hObject



614
615
616
617
618
619
620
621
622
623
624
# File 'lib/postproxy/types.rb', line 614

def to_h
  result = {}
  %i[facebook instagram tiktok linkedin youtube pinterest threads twitter bluesky telegram google_business].each do |platform|
    value = send(platform)
    next if value.nil?

    params = value.is_a?(Model) ? value.to_h : value
    result[platform] = params.reject { |_, v| v.nil? }
  end
  result
end