Class: ZaloAPI::Resource
- Inherits:
-
Object
- Object
- ZaloAPI::Resource
- Defined in:
- lib/zalo_api/resource.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
Instance Method Summary collapse
- #base_url ⇒ Object
-
#initialize(client, attributes = {}) ⇒ Resource
constructor
Create a new resource instance.
Constructor Details
#initialize(client, attributes = {}) ⇒ Resource
Create a new resource instance.
10 11 12 13 14 15 |
# File 'lib/zalo_api/resource.rb', line 10 def initialize(client, attributes = {}) raise "Expected a Hash for attributes, got #{attributes.inspect}" unless attributes.is_a?(Hash) @client = client @attributes = attributes end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
5 6 7 |
# File 'lib/zalo_api/resource.rb', line 5 def attributes @attributes end |
Instance Method Details
#base_url ⇒ Object
17 18 19 20 |
# File 'lib/zalo_api/resource.rb', line 17 def base_url @base_url ||= "%s/%s" % [ZaloAPI::Config::OA_API_BASE, ZaloAPI::Config::OA_API_VERSION] return @base_url end |