class Telegraph::Parser::Article

Constants

ATTRIBUTES

Public Class Methods

find(article_id, image_prefix: '') click to toggle source
# File lib/telegraph/parser/article.rb, line 15
def self.find(article_id, image_prefix: '')
  parser = Parser.new(article_id, image_prefix)
  parser.fetch_and_parse!
  Article.new(parser.parsed_data)
end
new(attributes, image_prefix: '') click to toggle source
# File lib/telegraph/parser/article.rb, line 8
def initialize(attributes, image_prefix: '')
  attributes.each do |attr, val|
    next unless ATTRIBUTES.include?(attr.to_sym)
    instance_variable_set(:"@#{attr}", val)
  end
end