Class: Atig::Command::Command
- Inherits:
-
Object
- Object
- Atig::Command::Command
- Defined in:
- lib/atig/command/command.rb
Direct Known Subclasses
Autofix, Destroy, Dm, Favorite, Limit, Location, Name, Option, Refresh, Reply, Retweet, Search, Spam, Status, Thread, Time, Uptime, User, UserInfo, Version, Whois
Instance Attribute Summary collapse
-
#api ⇒ Object
readonly
Returns the value of attribute api.
-
#db ⇒ Object
readonly
Returns the value of attribute db.
-
#gateway ⇒ Object
readonly
Returns the value of attribute gateway.
-
#opts ⇒ Object
readonly
Returns the value of attribute opts.
Instance Method Summary collapse
- #find_by_tid(tid) ⇒ Object
-
#initialize(context, gateway, api, db) ⇒ Command
constructor
A new instance of Command.
Constructor Details
#initialize(context, gateway, api, db) ⇒ Command
Returns a new instance of Command.
6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/atig/command/command.rb', line 6 def initialize(context, gateway, api, db) @log = context.log @opts = context.opts @gateway = gateway @api = api @db = db @gateway.ctcp_action(*command_name) do |target, mesg, command, args| action(target, mesg, command, args){|m| gateway[target].notify m } end end |
Instance Attribute Details
#api ⇒ Object (readonly)
Returns the value of attribute api.
5 6 7 |
# File 'lib/atig/command/command.rb', line 5 def api @api end |
#db ⇒ Object (readonly)
Returns the value of attribute db.
5 6 7 |
# File 'lib/atig/command/command.rb', line 5 def db @db end |
#gateway ⇒ Object (readonly)
Returns the value of attribute gateway.
5 6 7 |
# File 'lib/atig/command/command.rb', line 5 def gateway @gateway end |
#opts ⇒ Object (readonly)
Returns the value of attribute opts.
5 6 7 |
# File 'lib/atig/command/command.rb', line 5 def opts @opts end |
Instance Method Details
#find_by_tid(tid) ⇒ Object
19 20 21 |
# File 'lib/atig/command/command.rb', line 19 def find_by_tid(tid) @db.statuses.find_by_tid tid end |