Class: Msgtrail::Article

Inherits:
Object
  • Object
show all
Defined in:
lib/msgtrail/article.rb

Constant Summary collapse

TYPE_FILE =
'file'
TYPE_GIST =
'gist'
TYPE_TWEET =
'tweet'

Class Method Summary collapse

Class Method Details

.fetch_file_based_article(working_directory, article) ⇒ Object

Using :bodies array for file, gists, and tweets even though for file-based articles only a single file is supported at the moment.

For the sake of symmetry and future expansion :bodies is used for all three article types.



17
18
19
# File 'lib/msgtrail/article.rb', line 17

def self.fetch_file_based_article(working_directory, article)
  article[:bodies] = MarkdownFile.file_bodies(working_directory, article)
end

.fetch_gist_based_article(article) ⇒ Object



21
22
23
# File 'lib/msgtrail/article.rb', line 21

def self.fetch_gist_based_article(article)
  article[:bodies] = GitHub.gist_bodies(article[:gist_id])
end

.fetch_tweet_based_article(article) ⇒ Object



25
26
27
# File 'lib/msgtrail/article.rb', line 25

def self.fetch_tweet_based_article(article)
  article[:bodies] = Twitter.tweet_bodies(article[:tweet_ids])
end