Class: EmailDirect::Database
- Inherits:
-
Object
- Object
- EmailDirect::Database
- Defined in:
- lib/emaildirect/database.rb
Overview
Represents a database and associated functionality
Instance Attribute Summary collapse
-
#column_name ⇒ Object
readonly
Returns the value of attribute column_name.
Class Method Summary collapse
Instance Method Summary collapse
- #details ⇒ Object
-
#initialize(column_name) ⇒ Database
constructor
A new instance of Database.
Constructor Details
#initialize(column_name) ⇒ Database
Returns a new instance of Database.
22 23 24 |
# File 'lib/emaildirect/database.rb', line 22 def initialize(column_name) @column_name = column_name end |
Instance Attribute Details
#column_name ⇒ Object (readonly)
Returns the value of attribute column_name.
20 21 22 |
# File 'lib/emaildirect/database.rb', line 20 def column_name @column_name end |
Class Method Details
.all ⇒ Object
8 9 10 11 |
# File 'lib/emaildirect/database.rb', line 8 def all response = EmailDirect.get '/Database' Hashie::Mash.new(response) end |
.create(name, options = {}) ⇒ Object
13 14 15 16 17 |
# File 'lib/emaildirect/database.rb', line 13 def create(name, = {}) .merge! :ColumnName => name response = EmailDirect.post '/Database', :body => .to_json Hashie::Mash.new(response) end |
Instance Method Details
#details ⇒ Object
26 27 28 29 |
# File 'lib/emaildirect/database.rb', line 26 def details response = EmailDirect.get "/Database/#{column_name}" Hashie::Mash.new(response) end |