Class: APDM::Channel
- Inherits:
-
Object
- Object
- APDM::Channel
- Defined in:
- lib/apdm/channel.rb
Instance Attribute Summary collapse
-
#abbreviation ⇒ Object
Returns the value of attribute abbreviation.
-
#ad_tech_id ⇒ Object
Returns the value of attribute ad_tech_id.
-
#domain ⇒ Object
Returns the value of attribute domain.
-
#label ⇒ Object
Returns the value of attribute label.
-
#locale ⇒ Object
Returns the value of attribute locale.
-
#name ⇒ Object
Returns the value of attribute name.
-
#origo_sandbox_id ⇒ Object
Returns the value of attribute origo_sandbox_id.
-
#payment_account ⇒ Object
Returns the value of attribute payment_account.
-
#tld ⇒ Object
Returns the value of attribute tld.
Class Method Summary collapse
- .all ⇒ Object
- .find(identifier) ⇒ Object
- .find_by_ad_tech_id(id) ⇒ Object
-
.find_by_domain(url) ⇒ Object
DEPRECATED.
- .find_by_label(label) ⇒ Object
- .find_by_url(url) ⇒ Object
Instance Method Summary collapse
- #==(other) ⇒ Object
- #feed_url(options) ⇒ Object
- #homepage ⇒ Object
- #hostname ⇒ Object
-
#initialize(options = {}) ⇒ Channel
constructor
A new instance of Channel.
- #logo_src ⇒ Object
- #low_res_logo_src ⇒ Object
- #payment_config ⇒ Object
- #saxo_config ⇒ Object
- #saxo_dir ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Channel
Returns a new instance of Channel.
35 36 37 38 39 40 41 42 43 44 |
# File 'lib/apdm/channel.rb', line 35 def initialize( = {}) self.label = [:label] self.tld = [:tld] || 'no' self.abbreviation = [:abbreviation].downcase if [:abbreviation] self.name = [:name] self.payment_account = [:payment_account] self.ad_tech_id = [:ad_tech_id] self.locale = [:locale] self.origo_sandbox_id = [:origo_sandbox_id] end |
Instance Attribute Details
#abbreviation ⇒ Object
Returns the value of attribute abbreviation.
34 35 36 |
# File 'lib/apdm/channel.rb', line 34 def abbreviation @abbreviation end |
#ad_tech_id ⇒ Object
Returns the value of attribute ad_tech_id.
34 35 36 |
# File 'lib/apdm/channel.rb', line 34 def ad_tech_id @ad_tech_id end |
#domain ⇒ Object
Returns the value of attribute domain.
34 35 36 |
# File 'lib/apdm/channel.rb', line 34 def domain @domain end |
#label ⇒ Object
Returns the value of attribute label.
34 35 36 |
# File 'lib/apdm/channel.rb', line 34 def label @label end |
#locale ⇒ Object
Returns the value of attribute locale.
34 35 36 |
# File 'lib/apdm/channel.rb', line 34 def locale @locale end |
#name ⇒ Object
Returns the value of attribute name.
34 35 36 |
# File 'lib/apdm/channel.rb', line 34 def name @name end |
#origo_sandbox_id ⇒ Object
Returns the value of attribute origo_sandbox_id.
34 35 36 |
# File 'lib/apdm/channel.rb', line 34 def origo_sandbox_id @origo_sandbox_id end |
#payment_account ⇒ Object
Returns the value of attribute payment_account.
34 35 36 |
# File 'lib/apdm/channel.rb', line 34 def payment_account @payment_account end |
#tld ⇒ Object
Returns the value of attribute tld.
34 35 36 |
# File 'lib/apdm/channel.rb', line 34 def tld @tld end |
Class Method Details
.find(identifier) ⇒ Object
12 13 14 |
# File 'lib/apdm/channel.rb', line 12 def find(identifier) find_by_label(identifier) || find_by_url(identifier) end |
.find_by_ad_tech_id(id) ⇒ Object
29 30 31 |
# File 'lib/apdm/channel.rb', line 29 def find_by_ad_tech_id(id) APDM::CHANNELS.find_by_ad_tech_id(id) end |
.find_by_domain(url) ⇒ Object
DEPRECATED
25 26 27 |
# File 'lib/apdm/channel.rb', line 25 def find_by_domain(url) find_by_url(url) end |
Instance Method Details
#==(other) ⇒ Object
83 84 85 |
# File 'lib/apdm/channel.rb', line 83 def ==(other) label == other.label end |
#feed_url(options) ⇒ Object
62 63 64 65 |
# File 'lib/apdm/channel.rb', line 62 def feed_url() = {:extendedFeed => true}.merge() "#{homepage}/service/rss?#{QueryParams.encode()}" end |
#homepage ⇒ Object
50 51 52 |
# File 'lib/apdm/channel.rb', line 50 def homepage "http://#{hostname}" end |
#hostname ⇒ Object
54 55 56 |
# File 'lib/apdm/channel.rb', line 54 def hostname "www.#{domain}" end |
#logo_src ⇒ Object
67 68 69 |
# File 'lib/apdm/channel.rb', line 67 def logo_src "#{APDM::DesignElements::HOST}#{hostname}/gfx/normal_logo.gif" end |
#low_res_logo_src ⇒ Object
71 72 73 |
# File 'lib/apdm/channel.rb', line 71 def low_res_logo_src "#{APDM::DesignElements::HOST}#{hostname}/gfx/lav_logo.gif" end |
#payment_config ⇒ Object
79 80 81 |
# File 'lib/apdm/channel.rb', line 79 def payment_config APDM.merchant_account.merge :account => payment_account end |
#saxo_config ⇒ Object
75 76 77 |
# File 'lib/apdm/channel.rb', line 75 def saxo_config APDM.saxo_server.merge :remote_dir => saxo_dir end |
#saxo_dir ⇒ Object
46 47 48 |
# File 'lib/apdm/channel.rb', line 46 def saxo_dir abbreviation.upcase end |