module SocialPoster
Constants
- VERSION
Public Class Methods
fb=(value)
click to toggle source
# File lib/social_poster.rb, line 28 def self.fb= value @@fb = value end
get_config(name)
click to toggle source
# File lib/social_poster.rb, line 19 def self.get_config(name) { facebook: @@fb, livejournal: @@lj, vkontakte: @@vk, twitter: @@twitter }[name.to_sym] end
lj=(value)
click to toggle source
# File lib/social_poster.rb, line 32 def self.lj= value @@lj = value end
setup() { |self| ... }
click to toggle source
# File lib/social_poster.rb, line 15 def self.setup yield self end
twitter=(value)
click to toggle source
# File lib/social_poster.rb, line 40 def self.twitter= value @@twitter = value end
vk=(value)
click to toggle source
# File lib/social_poster.rb, line 36 def self.vk= value @@vk = value end
write(network, text, title = '', options = {})
click to toggle source
# File lib/social_poster.rb, line 44 def self.write(network, text, title = '', options = {}) site = case network.to_sym when :fb site = Poster::Facebook.new(options) when :vk site = Poster::Vkontakte.new(options) when :twitter site = Poster::Twitter.new when :lj site = Poster::LiveJournal.new else raise "Unknown network #{network}" end site.write(text, title) end