Class: Sorenson::Services::Site
- Defined in:
- lib/sorenson/services/site.rb
Instance Attribute Summary collapse
-
#account_id ⇒ Object
Returns the value of attribute account_id.
-
#description ⇒ Object
Returns the value of attribute description.
-
#id ⇒ Object
Returns the value of attribute id.
-
#name ⇒ Object
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(data) ⇒ Site
constructor
A new instance of Site.
Methods inherited from Base
delete_from, get_from, host, login_no_resource, parse_response, post_to, put_to, verify_account_settings
Constructor Details
#initialize(data) ⇒ Site
Returns a new instance of Site.
17 18 19 20 21 22 |
# File 'lib/sorenson/services/site.rb', line 17 def initialize(data) @name = data['name'] @account_id = data['account_id'] @id = data['id'] @description = data['description'] end |
Instance Attribute Details
#account_id ⇒ Object
Returns the value of attribute account_id.
4 5 6 |
# File 'lib/sorenson/services/site.rb', line 4 def account_id @account_id end |
#description ⇒ Object
Returns the value of attribute description.
4 5 6 |
# File 'lib/sorenson/services/site.rb', line 4 def description @description end |
#id ⇒ Object
Returns the value of attribute id.
4 5 6 |
# File 'lib/sorenson/services/site.rb', line 4 def id @id end |
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/sorenson/services/site.rb', line 4 def name @name end |
Class Method Details
.all ⇒ Object
9 10 11 |
# File 'lib/sorenson/services/site.rb', line 9 def self.all get_from('/sites') end |
.create(name, options = {}) ⇒ Object
5 6 7 |
# File 'lib/sorenson/services/site.rb', line 5 def self.create(name, = {}) new(post_to('/sites', {:site => {:name => name}.merge()})) end |