Class: Impostor

Inherits:
Object
  • Object
show all
Defined in:
lib/impostor/wwf79.rb,
lib/impostor.rb,
lib/impostor/wwf80.rb,
lib/impostor/errors.rb,
lib/impostor/phpbb2.rb,
lib/impostor/phpbb3.rb

Overview

phpBB3 version of the Impostor

Defined Under Namespace

Modules: Phpbb2, Phpbb3, Wwf79, Wwf80 Classes: Auth, Config, ConfigError, ImpostorError, LoginError, MissingTemplateMethodError, Post, PostError, PostModerated, ThrottledError, Topic, TopicError, TopicModerated

Constant Summary collapse

VERSION =

Gem version of Impostor

'1.3.2'

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config = {}) ⇒ Impostor

Pass in a config hash to initialize

Raises:



58
59
60
61
62
63
64
65
66
67
68
# File 'lib/impostor.rb', line 58

def initialize(config={})
  @config = Config.new(config)
  @auth   = Auth.new(@config)
  @post   = Post.new(@config, @auth)
  @topic  = Topic.new(@config, @auth)

  type = @config.type
  raise ConfigError.new("Missing 'type' key in configuration") unless type

  extend eval("Impostor::#{type.to_s.capitalize}")
end

Class Method Details

.not_tested(who, what) ⇒ Object



98
99
100
101
102
103
104
105
# File 'lib/impostor.rb', line 98

def self.not_tested(who, what)
  warn <<WARNMSG
!!!!! IMPLEMENTATION WARNING !!!!!
#{who}##{what} did not have real integration test data to work against in the
refactoring of Impostor from version 0.2.1 to 1.0.0.  Please contact the author
to help supply live data allowing real integration tests for this method.
WARNMSG
end

Instance Method Details

#loginObject

Login



94
95
96
# File 'lib/impostor.rb', line 94

def 
  @auth.
end

#new_topic(forum, subject, message) ⇒ Object

Make a new topic



87
88
89
# File 'lib/impostor.rb', line 87

def new_topic(forum, subject, message)
  @topic.new_topic(forum, subject, message)
end

#post(forum, topic, message) ⇒ Object

Post the message



80
81
82
# File 'lib/impostor.rb', line 80

def post(forum, topic, message)
  @post.post(forum, topic, message)
end

#versionObject

our version



73
74
75
# File 'lib/impostor.rb', line 73

def version
  VERSION
end