Class: GSGraph::AdKeyword

Inherits:
Node
  • Object
show all
Extended by:
Searchable
Defined in:
lib/gs_graph/ad_keyword.rb

Direct Known Subclasses

AdKeywordSuggestion

Instance Attribute Summary collapse

Attributes inherited from Node

#access_token, #endpoint, #identifier, #raw_attributes

Instance Method Summary collapse

Methods included from Searchable

search, search, search_query_param

Methods inherited from Node

#connection, #destroy, fetch, #fetch, #update

Methods included from Comparison

#==

Constructor Details

#initialize(identifier, attributes = {}) ⇒ AdKeyword

Returns a new instance of AdKeyword.



7
8
9
10
11
12
13
# File 'lib/gs_graph/ad_keyword.rb', line 7

def initialize(identifier, attributes = {})
  super

  %w(name description).each do |field|
    self.send("#{field}=", attributes[field.to_sym])
  end
end

Instance Attribute Details

#descriptionObject

Returns the value of attribute description.



5
6
7
# File 'lib/gs_graph/ad_keyword.rb', line 5

def description
  @description
end

#nameObject

Returns the value of attribute name.



5
6
7
# File 'lib/gs_graph/ad_keyword.rb', line 5

def name
  @name
end

Instance Method Details

#topic_keyword?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/gs_graph/ad_keyword.rb', line 15

def topic_keyword?
  (name =~ /^#/) == 0
end