Class: RubyPocket::FavoriteCreator

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/ruby_pocket/favorite_creator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params) ⇒ FavoriteCreator

Returns a new instance of FavoriteCreator.



14
15
16
# File 'lib/ruby_pocket/favorite_creator.rb', line 14

def initialize(params)
  @params = params
end

Instance Attribute Details

#web_page=(value) ⇒ Object

Sets the attribute web_page

Parameters:

  • value

    the value to set the attribute web_page to.



10
11
12
# File 'lib/ruby_pocket/favorite_creator.rb', line 10

def web_page=(value)
  @web_page = value
end

Instance Method Details

#favorite=(favorite) ⇒ Object



18
19
20
21
# File 'lib/ruby_pocket/favorite_creator.rb', line 18

def favorite=(favorite)
  fail 'Must be a new favorite' unless favorite.new?
  @favorite = favorite
end

#saveObject



23
24
25
26
27
# File 'lib/ruby_pocket/favorite_creator.rb', line 23

def save
  fetch_missing_data
  assign_params
  save_favorite
end