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.



498
499
500
# File 'lib/postproxy/types.rb', line 498

def bluesky
  @bluesky
end

#facebookObject

Returns the value of attribute facebook.



498
499
500
# File 'lib/postproxy/types.rb', line 498

def facebook
  @facebook
end

#google_businessObject

Returns the value of attribute google_business.



498
499
500
# File 'lib/postproxy/types.rb', line 498

def google_business
  @google_business
end

#instagramObject

Returns the value of attribute instagram.



498
499
500
# File 'lib/postproxy/types.rb', line 498

def instagram
  @instagram
end

#linkedinObject

Returns the value of attribute linkedin.



498
499
500
# File 'lib/postproxy/types.rb', line 498

def linkedin
  @linkedin
end

#pinterestObject

Returns the value of attribute pinterest.



498
499
500
# File 'lib/postproxy/types.rb', line 498

def pinterest
  @pinterest
end

#telegramObject

Returns the value of attribute telegram.



498
499
500
# File 'lib/postproxy/types.rb', line 498

def telegram
  @telegram
end

#threadsObject

Returns the value of attribute threads.



498
499
500
# File 'lib/postproxy/types.rb', line 498

def threads
  @threads
end

#tiktokObject

Returns the value of attribute tiktok.



498
499
500
# File 'lib/postproxy/types.rb', line 498

def tiktok
  @tiktok
end

#twitterObject

Returns the value of attribute twitter.



498
499
500
# File 'lib/postproxy/types.rb', line 498

def twitter
  @twitter
end

#youtubeObject

Returns the value of attribute youtube.



498
499
500
# File 'lib/postproxy/types.rb', line 498

def youtube
  @youtube
end

Instance Method Details

#to_hObject



501
502
503
504
505
506
507
508
509
510
511
# File 'lib/postproxy/types.rb', line 501

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