Class: Kloudless::Model
- Inherits:
-
Object
- Object
- Kloudless::Model
- Defined in:
- lib/kloudless/model.rb
Overview
Public: Base class for different API resources. e.g. Account, Files, Folders.
Class Method Summary collapse
Instance Method Summary collapse
- #http ⇒ Object
-
#initialize(attributes = {}) ⇒ Model
constructor
A new instance of Model.
- #method_missing(name, *args, &blk) ⇒ Object
Constructor Details
#initialize(attributes = {}) ⇒ Model
Returns a new instance of Model.
12 13 14 |
# File 'lib/kloudless/model.rb', line 12 def initialize(attributes = {}) @attributes = attributes end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &blk) ⇒ Object
16 17 18 |
# File 'lib/kloudless/model.rb', line 16 def method_missing(name, *args, &blk) @attributes[name.to_s] || super end |
Class Method Details
Instance Method Details
#http ⇒ Object
8 9 10 |
# File 'lib/kloudless/model.rb', line 8 def http self.class.http end |