Class: WikihowTechTopics::WikihowTechTopicModel
- Inherits:
-
Object
- Object
- WikihowTechTopics::WikihowTechTopicModel
- Defined in:
- lib/wikihow_tech_topics/wikihow_tech_topic_model.rb
Constant Summary collapse
- @@all =
[]
Instance Attribute Summary collapse
-
#content ⇒ Object
Returns the value of attribute content.
-
#content_array ⇒ Object
readonly
Returns the value of attribute content_array.
-
#home_page ⇒ Object
readonly
Returns the value of attribute home_page.
-
#title ⇒ Object
Returns the value of attribute title.
-
#title_array ⇒ Object
readonly
Returns the value of attribute title_array.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(title = nil, content = nil) ⇒ WikihowTechTopicModel
constructor
A new instance of WikihowTechTopicModel.
Constructor Details
#initialize(title = nil, content = nil) ⇒ WikihowTechTopicModel
Returns a new instance of WikihowTechTopicModel.
12 13 14 15 16 |
# File 'lib/wikihow_tech_topics/wikihow_tech_topic_model.rb', line 12 def initialize(title = nil, content = nil) @title = title @content = content @@all << self end |
Instance Attribute Details
#content ⇒ Object
Returns the value of attribute content.
7 8 9 |
# File 'lib/wikihow_tech_topics/wikihow_tech_topic_model.rb', line 7 def content @content end |
#content_array ⇒ Object (readonly)
Returns the value of attribute content_array.
8 9 10 |
# File 'lib/wikihow_tech_topics/wikihow_tech_topic_model.rb', line 8 def content_array @content_array end |
#home_page ⇒ Object (readonly)
Returns the value of attribute home_page.
8 9 10 |
# File 'lib/wikihow_tech_topics/wikihow_tech_topic_model.rb', line 8 def home_page @home_page end |
#title ⇒ Object
Returns the value of attribute title.
7 8 9 |
# File 'lib/wikihow_tech_topics/wikihow_tech_topic_model.rb', line 7 def title @title end |
#title_array ⇒ Object (readonly)
Returns the value of attribute title_array.
8 9 10 |
# File 'lib/wikihow_tech_topics/wikihow_tech_topic_model.rb', line 8 def title_array @title_array end |
Class Method Details
.all ⇒ Object
34 35 36 |
# File 'lib/wikihow_tech_topics/wikihow_tech_topic_model.rb', line 34 def self.all @@all end |
.content_from_content_array ⇒ Object
25 26 27 28 29 30 31 32 |
# File 'lib/wikihow_tech_topics/wikihow_tech_topic_model.rb', line 25 def self.content_from_content_array content_array = WikihowTechTopics::Scraper.scraped_content_array title_array.each do |title| @title.content = WikihowTechTopics::WikihowTechTopicModel.new binding.pry # self.new(title) end end |
.titles_from_title_array ⇒ Object
18 19 20 21 22 23 |
# File 'lib/wikihow_tech_topics/wikihow_tech_topic_model.rb', line 18 def self.titles_from_title_array title_array = WikihowTechTopics::Scraper.scraped_title_array title_array.each do |title| self.new(title) end end |