Class: GuardianContent::Base
- Inherits:
-
Object
- Object
- GuardianContent::Base
- Includes:
- HTTParty
- Defined in:
- lib/guardian-content.rb
Instance Method Summary collapse
-
#initialize(key = nil) ⇒ Base
constructor
A new instance of Base.
- #reload(options = nil) ⇒ Object
Constructor Details
#initialize(key = nil) ⇒ Base
Returns a new instance of Base.
14 15 16 17 18 19 |
# File 'lib/guardian-content.rb', line 14 def initialize(key = nil) if defined?(GUARDIAN_CONTENT_API_KEY) key = GUARDIAN_CONTENT_API_KEY end self.class.default_params "api-key" => key, "format" => "json" end |
Instance Method Details
#reload(options = nil) ⇒ Object
21 22 23 24 |
# File 'lib/guardian-content.rb', line 21 def reload( = nil) @attributes.update(self.class.find_by_id(self.id, ).instance_variable_get('@attributes')) self end |