Class: Enstratus::Resource
- Inherits:
-
Object
- Object
- Enstratus::Resource
- Defined in:
- lib/enstratus/resource.rb
Direct Known Subclasses
Admin::Account, Admin::Acl, Admin::ApiKey, Admin::BillingCode, Admin::Customer, Admin::Group, Admin::Job, Admin::Role, Admin::User, Analytics::ServerAnalytics, Analytics::TierAnalytics, Automation::Deployment, Automation::DeploymentLoadBalancer, Automation::Tier, Finance::ServerPrepayment, Geography::Cloud, Geography::DataCenter, Geography::Region, Geography::Subscription, Infrastructure::MachineImage, Infrastructure::Server, Infrastructure::ServerProduct, Infrastructure::Snapshot, Infrastructure::Volume, Infrastructure::VolumeProduct
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(attrs = {}) ⇒ Resource
constructor
A new instance of Resource.
- #update_attributes(attrs) ⇒ Object
Constructor Details
#initialize(attrs = {}) ⇒ Resource
Returns a new instance of Resource.
9 10 11 12 |
# File 'lib/enstratus/resource.rb', line 9 def initialize(attrs = {}) @attributes = {} update_attributes(attrs) end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
3 4 5 |
# File 'lib/enstratus/resource.rb', line 3 def attributes @attributes end |
Class Method Details
.inherited(sub) ⇒ Object
5 6 7 |
# File 'lib/enstratus/resource.rb', line 5 def self.inherited(sub) sub.send :extend, Enstratus::ResourceClassMethods end |
Instance Method Details
#update_attributes(attrs) ⇒ Object
18 19 20 |
# File 'lib/enstratus/resource.rb', line 18 def update_attributes(attrs) attrs.each {|k,v| send(:"#{k}=", v)} end |