Class: KeywordsEverywhere::Item
- Inherits:
-
Object
- Object
- KeywordsEverywhere::Item
- Extended by:
- Forwardable
- Defined in:
- lib/keywords_everywhere/item.rb
Instance Attribute Summary collapse
-
#hash ⇒ Object
Returns the value of attribute hash.
Instance Method Summary collapse
- #competition ⇒ Object
- #cpc ⇒ Object
- #get(keys) ⇒ Object
-
#initialize(data) ⇒ Item
constructor
A new instance of Item.
- #keyword ⇒ Object
- #trend ⇒ Object
- #vol ⇒ Object
Constructor Details
#initialize(data) ⇒ Item
Returns a new instance of Item.
10 11 12 |
# File 'lib/keywords_everywhere/item.rb', line 10 def initialize(data) @hash = data end |
Instance Attribute Details
#hash ⇒ Object
Returns the value of attribute hash.
6 7 8 |
# File 'lib/keywords_everywhere/item.rb', line 6 def hash @hash end |
Instance Method Details
#competition ⇒ Object
26 27 28 |
# File 'lib/keywords_everywhere/item.rb', line 26 def competition get(%w{competition}) end |
#cpc ⇒ Object
18 19 20 |
# File 'lib/keywords_everywhere/item.rb', line 18 def cpc get(%w{cpc}) end |
#get(keys) ⇒ Object
34 35 36 |
# File 'lib/keywords_everywhere/item.rb', line 34 def get(keys) @hash.dig(*keys) end |
#keyword ⇒ Object
22 23 24 |
# File 'lib/keywords_everywhere/item.rb', line 22 def keyword get(%w{keyword}) end |
#trend ⇒ Object
30 31 32 |
# File 'lib/keywords_everywhere/item.rb', line 30 def trend get(%w{trend}) end |
#vol ⇒ Object
14 15 16 |
# File 'lib/keywords_everywhere/item.rb', line 14 def vol get(%w{vol}) end |