Class: Twingly::Analytics::Post

Inherits:
Object
  • Object
show all
Defined in:
lib/twingly-analytics/post.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#authorityObject (readonly)

Returns the value of attribute authority.



8
9
10
# File 'lib/twingly-analytics/post.rb', line 8

def authority
  @authority
end

#blog_nameObject (readonly)

Returns the value of attribute blog_name.



8
9
10
# File 'lib/twingly-analytics/post.rb', line 8

def blog_name
  @blog_name
end

#blog_rankObject (readonly)

Returns the value of attribute blog_rank.



8
9
10
# File 'lib/twingly-analytics/post.rb', line 8

def blog_rank
  @blog_rank
end

#blog_urlObject (readonly)

Returns the value of attribute blog_url.



8
9
10
# File 'lib/twingly-analytics/post.rb', line 8

def blog_url
  @blog_url
end

#indexedObject (readonly)

Returns the value of attribute indexed.



8
9
10
# File 'lib/twingly-analytics/post.rb', line 8

def indexed
  @indexed
end

#language_codeObject (readonly)

Returns the value of attribute language_code.



8
9
10
# File 'lib/twingly-analytics/post.rb', line 8

def language_code
  @language_code
end

#publishedObject (readonly)

Returns the value of attribute published.



8
9
10
# File 'lib/twingly-analytics/post.rb', line 8

def published
  @published
end

#summaryObject (readonly)

Returns the value of attribute summary.



8
9
10
# File 'lib/twingly-analytics/post.rb', line 8

def summary
  @summary
end

#tagsObject (readonly)

Returns the value of attribute tags.



8
9
10
# File 'lib/twingly-analytics/post.rb', line 8

def tags
  @tags
end

#titleObject (readonly)

Returns the value of attribute title.



8
9
10
# File 'lib/twingly-analytics/post.rb', line 8

def title
  @title
end

#urlObject (readonly)

Returns the value of attribute url.



8
9
10
# File 'lib/twingly-analytics/post.rb', line 8

def url
  @url
end

Instance Method Details

#set_values(params) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/twingly-analytics/post.rb', line 11

def set_values(params)
  @url           = params.fetch('url')
  @title         = params.fetch('title')
  @summary       = params.fetch('summary')
  @language_code = params.fetch('languageCode')
  @published     = DateTime.parse(params.fetch('published'))
  @indexed       = DateTime.parse(params.fetch('indexed'))
  @blog_url      = params.fetch('blogUrl')
  @blog_name     = params.fetch('blogName')
  @authority     = params.fetch('authority').to_i
  @blog_rank     = params.fetch('blogRank').to_i
  @tags          = params.fetch('tags', [])
end