Class: Delicious::Bundle
- Inherits:
-
Object
- Object
- Delicious::Bundle
- Includes:
- ActiveModel::Model, ActiveModel::Validations, ApiModel
- Defined in:
- lib/delicious/bundle.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#tags ⇒ Object
Returns the value of attribute tags.
Instance Method Summary collapse
-
#delete ⇒ Boolean
Deletes this bundle.
-
#save ⇒ Boolean
Creates or updates bundle.
- #to_s ⇒ Object
Methods included from ApiModel
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
9 10 11 |
# File 'lib/delicious/bundle.rb', line 9 def name @name end |
#tags ⇒ Object
Returns the value of attribute tags.
9 10 11 |
# File 'lib/delicious/bundle.rb', line 9 def @tags end |
Instance Method Details
#delete ⇒ Boolean
Deletes this bundle
18 19 20 21 22 23 24 |
# File 'lib/delicious/bundle.rb', line 18 def delete if persisted? && @delicious_client @delicious_client.bundles.delete bundle: name else fail Delicious::Error, 'Bundle was not saved yet' end end |
#save ⇒ Boolean
Creates or updates bundle
30 31 32 33 34 35 36 37 |
# File 'lib/delicious/bundle.rb', line 30 def save if @delicious_client @delicious_client.bundles.set name, true else fail 'Bundle was not saved yet' end end |
#to_s ⇒ Object
39 40 41 |
# File 'lib/delicious/bundle.rb', line 39 def to_s %Q(Delicious::Bundle(name: "#{name}", tags: #{})) end |