Module: TildeScraper::Memorable::ClassMethods

Included in:
Comment, Group, Page, Topic
Defined in:
lib/tilde_scraper/concerns/memorable.rb

Instance Method Summary collapse

Instance Method Details

#create(attributes) ⇒ Object



3
4
5
6
7
# File 'lib/tilde_scraper/concerns/memorable.rb', line 3

def create(attributes)
  topic = new(attributes)
  self.all << topic
  topic
end

#create_from_array(array) ⇒ Object



9
10
11
12
13
# File 'lib/tilde_scraper/concerns/memorable.rb', line 9

def create_from_array(array)
  array.map do |hash|
    create(hash)
  end
end