Class: Html2rss::Capture::CaptureResult

Inherits:
Data
  • Object
show all
Defined in:
lib/html2rss/capture.rb

Overview

Result of a capture operation (config plus quality meta).

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config:, articles_count:, channel_title:, has_selectors:, segment_strategy:, yaml: nil, admission_drops: {}, selected_strategy: nil, inferred_topics: [], native_feed: nil, suggested_channel_url: nil) ⇒ CaptureResult

rubocop:disable Metrics/ParameterLists

Parameters:

  • config (Hash)
  • articles_count (Integer)
  • channel_title (String)
  • has_selectors (Boolean)
  • segment_strategy (Symbol)
  • yaml (String, nil) (defaults to: nil)
  • admission_drops (Hash) (defaults to: {})
  • selected_strategy (Symbol, nil) (defaults to: nil)
  • inferred_topics (Array<String>) (defaults to: [])
  • native_feed (String, nil) (defaults to: nil)
  • suggested_channel_url (String, nil) (defaults to: nil)


47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/html2rss/capture.rb', line 47

def initialize(config:, articles_count:, channel_title:, has_selectors:, segment_strategy:, # rubocop:disable Metrics/MethodLength
               yaml: nil, admission_drops: {}, selected_strategy: nil, inferred_topics: [], native_feed: nil,
               suggested_channel_url: nil)
  super(
    config:,
    yaml: yaml || "#{SCHEMA_MODELINE}\n#{Config.to_yaml(config)}",
    articles_count:,
    channel_title:,
    has_selectors:,
    segment_strategy:,
    admission_drops:,
    selected_strategy:,
    inferred_topics:,
    native_feed:,
    suggested_channel_url:
  )
end

Instance Attribute Details

#admission_dropsObject (readonly)

Returns the value of attribute admission_drops

Returns:

  • (Object)

    the current value of admission_drops



30
31
32
# File 'lib/html2rss/capture.rb', line 30

def admission_drops
  @admission_drops
end

#articles_countObject (readonly)

Returns the value of attribute articles_count

Returns:

  • (Object)

    the current value of articles_count



30
31
32
# File 'lib/html2rss/capture.rb', line 30

def articles_count
  @articles_count
end

#channel_titleObject (readonly)

Returns the value of attribute channel_title

Returns:

  • (Object)

    the current value of channel_title



30
31
32
# File 'lib/html2rss/capture.rb', line 30

def channel_title
  @channel_title
end

#configObject (readonly)

Returns the value of attribute config

Returns:

  • (Object)

    the current value of config



30
31
32
# File 'lib/html2rss/capture.rb', line 30

def config
  @config
end

#has_selectorsObject (readonly)

Returns the value of attribute has_selectors

Returns:

  • (Object)

    the current value of has_selectors



30
31
32
# File 'lib/html2rss/capture.rb', line 30

def has_selectors
  @has_selectors
end

#inferred_topicsObject (readonly)

Returns the value of attribute inferred_topics

Returns:

  • (Object)

    the current value of inferred_topics



30
31
32
# File 'lib/html2rss/capture.rb', line 30

def inferred_topics
  @inferred_topics
end

#native_feedObject (readonly)

Returns the value of attribute native_feed

Returns:

  • (Object)

    the current value of native_feed



30
31
32
# File 'lib/html2rss/capture.rb', line 30

def native_feed
  @native_feed
end

#segment_strategyObject (readonly)

Returns the value of attribute segment_strategy

Returns:

  • (Object)

    the current value of segment_strategy



30
31
32
# File 'lib/html2rss/capture.rb', line 30

def segment_strategy
  @segment_strategy
end

#selected_strategyObject (readonly)

Returns the value of attribute selected_strategy

Returns:

  • (Object)

    the current value of selected_strategy



30
31
32
# File 'lib/html2rss/capture.rb', line 30

def selected_strategy
  @selected_strategy
end

#suggested_channel_urlObject (readonly)

Returns the value of attribute suggested_channel_url

Returns:

  • (Object)

    the current value of suggested_channel_url



30
31
32
# File 'lib/html2rss/capture.rb', line 30

def suggested_channel_url
  @suggested_channel_url
end

#yamlObject (readonly)

Returns the value of attribute yaml

Returns:

  • (Object)

    the current value of yaml



30
31
32
# File 'lib/html2rss/capture.rb', line 30

def yaml
  @yaml
end

Instance Method Details

#native_feed?Boolean

Returns whether first-party RSS was detected.

Returns:

  • (Boolean)

    whether first-party RSS was detected



68
69
70
# File 'lib/html2rss/capture.rb', line 68

def native_feed?
  !native_feed.nil?
end