Class: PageElement

Inherits:
ActiveResource::Base
  • Object
show all
Defined in:
lib/magnifier/page_element.rb

Instance Method Summary collapse

Instance Method Details

#replace_content(old_value, new_value) ⇒ Object



6
7
8
9
10
11
12
13
14
# File 'lib/magnifier/page_element.rb', line 6

def replace_content(old_value, new_value)
	if content.include? old_value
 	c = content.gsub(old_value, new_value)
 	self.content = c
 	self.save
 else
 	return false
 end
end

#use_photo(url) ⇒ Object

upload or use a photo



17
18
19
# File 'lib/magnifier/page_element.rb', line 17

def use_photo(url)
  self.post :update_with_photo, url: url
end