Class: Zanox::AdSpace
Instance Attribute Summary collapse
-
#categories ⇒ Object
readonly
Returns the value of attribute categories.
-
#check_number ⇒ Object
readonly
Returns the value of attribute check_number.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#impressions ⇒ Object
readonly
Returns the value of attribute impressions.
-
#language ⇒ Object
readonly
Returns the value of attribute language.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#pid ⇒ Object
readonly
Returns the value of attribute pid.
-
#regions ⇒ Object
readonly
Returns the value of attribute regions.
-
#scope ⇒ Object
readonly
Returns the value of attribute scope.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
-
#visitors ⇒ Object
readonly
Returns the value of attribute visitors.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(data) ⇒ AdSpace
constructor
-
pid (Integer) AdSpace ID - name (String) The name of the adspace - url (String) The URL to the adspace - description (String) The description of the adspace - type (String) The type of the adspace (website, email, searchengine) - visitors (Integer) How many visitors Zanox tracked for you - impressions (Integer) The number of impressions of the adspace - scope (String) The scope of the adspace (private, bussiness) - regions (String[]) The regions where the adspace works - categories (String[]) The categories of the adspace - language (String) The language used inside the adspace - check_number (Integer).
-
Methods included from Hashable
Constructor Details
#initialize(data) ⇒ AdSpace
-
pid (Integer) AdSpace ID
-
name (String) The name of the adspace
-
url (String) The URL to the adspace
-
description (String) The description of the adspace
-
type (String) The type of the adspace (website, email, searchengine)
-
visitors (Integer) How many visitors Zanox tracked for you
-
impressions (Integer) The number of impressions of the adspace
-
scope (String) The scope of the adspace (private, bussiness)
-
regions (String[]) The regions where the adspace works
-
categories (String[]) The categories of the adspace
-
language (String) The language used inside the adspace
-
check_number (Integer)
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/zanox/resources/adspace.rb', line 44 def initialize(data) @pid = data['@id'].to_i @name = data['name'] @url = data['url'] @description = data['description'] @type = data['adspaceType'] @visitors = data['visitors'].to_i @impressions = data['impressions'].to_i @scope = data['scope'] @regions = [data['regions'].try { |r| r.map(&:values) }].flatten.compact @categories = [].tap do |categories| categories_ = data['categories'].try { |p| p[0]['category'] } data['categories'].try { |p| p[0]['category'] }.each do |category| categories << { id: category[0], name: category[1], } end end @language = data['language'] @check_number = data['checkNumber'] end |
Instance Attribute Details
#categories ⇒ Object (readonly)
Returns the value of attribute categories.
27 28 29 |
# File 'lib/zanox/resources/adspace.rb', line 27 def categories @categories end |
#check_number ⇒ Object (readonly)
Returns the value of attribute check_number.
27 28 29 |
# File 'lib/zanox/resources/adspace.rb', line 27 def check_number @check_number end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
27 28 29 |
# File 'lib/zanox/resources/adspace.rb', line 27 def description @description end |
#impressions ⇒ Object (readonly)
Returns the value of attribute impressions.
27 28 29 |
# File 'lib/zanox/resources/adspace.rb', line 27 def impressions @impressions end |
#language ⇒ Object (readonly)
Returns the value of attribute language.
27 28 29 |
# File 'lib/zanox/resources/adspace.rb', line 27 def language @language end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
27 28 29 |
# File 'lib/zanox/resources/adspace.rb', line 27 def name @name end |
#pid ⇒ Object (readonly)
Returns the value of attribute pid.
27 28 29 |
# File 'lib/zanox/resources/adspace.rb', line 27 def pid @pid end |
#regions ⇒ Object (readonly)
Returns the value of attribute regions.
27 28 29 |
# File 'lib/zanox/resources/adspace.rb', line 27 def regions @regions end |
#scope ⇒ Object (readonly)
Returns the value of attribute scope.
27 28 29 |
# File 'lib/zanox/resources/adspace.rb', line 27 def scope @scope end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
27 28 29 |
# File 'lib/zanox/resources/adspace.rb', line 27 def type @type end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
27 28 29 |
# File 'lib/zanox/resources/adspace.rb', line 27 def url @url end |
#visitors ⇒ Object (readonly)
Returns the value of attribute visitors.
27 28 29 |
# File 'lib/zanox/resources/adspace.rb', line 27 def visitors @visitors end |