Class: Baza::Driver::Mysql::User
- Inherits:
-
Object
- Object
- Baza::Driver::Mysql::User
show all
- Defined in:
- lib/baza/driver/mysql/user.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(args) ⇒ User
4
5
6
7
8
|
# File 'lib/baza/driver/mysql/user.rb', line 4
def initialize(args)
@args = args
@data = args.fetch(:data)
@db = args.fetch(:db)
end
|
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
2
3
4
|
# File 'lib/baza/driver/mysql/user.rb', line 2
def name
@name
end
|
Instance Method Details
#drop ⇒ Object
18
19
20
21
|
# File 'lib/baza/driver/mysql/user.rb', line 18
def drop
@db.query("DROP USER '#{@db.esc(name)}'@'#{@db.esc(host)}'")
true
end
|
#host ⇒ Object
14
15
16
|
# File 'lib/baza/driver/mysql/user.rb', line 14
def host
@data.fetch(:Host)
end
|