Class: Baza::Driver::Mysql::User
- Inherits:
-
Object
- Object
- Baza::Driver::Mysql::User
- Defined in:
- lib/baza/driver/mysql/user.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #drop ⇒ Object
- #host ⇒ Object
-
#initialize(args) ⇒ User
constructor
A new instance of User.
Constructor Details
#initialize(args) ⇒ User
Returns a new instance of 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 (readonly)
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 |