Class: SeoFriendly::DataExtractor

Inherits:
Object
  • Object
show all
Defined in:
lib/seo_friendly/data_extractor.rb

Constant Summary collapse

EXTRACTORS =

a little bit of metaprogramming

{ title: TitleConstructor, description: DescriptionConstructor, keywords: KeyWordsConstructor }

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(source) ⇒ DataExtractor

Returns a new instance of DataExtractor.



11
12
13
14
# File 'lib/seo_friendly/data_extractor.rb', line 11

def initialize(source)
  @source = source
  extract_information
end

Instance Attribute Details

#descriptionObject (readonly)

Returns the value of attribute description.



6
7
8
# File 'lib/seo_friendly/data_extractor.rb', line 6

def description
  @description
end

#keywordsObject (readonly)

Returns the value of attribute keywords.



6
7
8
# File 'lib/seo_friendly/data_extractor.rb', line 6

def keywords
  @keywords
end

#sourceObject (readonly)

Returns the value of attribute source.



6
7
8
# File 'lib/seo_friendly/data_extractor.rb', line 6

def source
  @source
end

#titleObject (readonly)

Returns the value of attribute title.



6
7
8
# File 'lib/seo_friendly/data_extractor.rb', line 6

def title
  @title
end

Instance Method Details

#seo_attributesObject



16
17
18
# File 'lib/seo_friendly/data_extractor.rb', line 16

def seo_attributes
  { title: title, description: description, keywords: keywords }
end