Class: CMSBinding::Category
Instance Attribute Summary collapse
-
#article_weblink ⇒ Object
readonly
Returns the value of attribute article_weblink.
-
#articles ⇒ Object
readonly
Returns the value of attribute articles.
-
#category_weblink ⇒ Object
readonly
Returns the value of attribute category_weblink.
-
#cdn_image_url ⇒ Object
readonly
Returns the value of attribute cdn_image_url.
-
#cdn_thumbnail_url ⇒ Object
readonly
Returns the value of attribute cdn_thumbnail_url.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#parent ⇒ Object
readonly
Returns the value of attribute parent.
-
#sub_categories ⇒ Object
readonly
Returns the value of attribute sub_categories.
Instance Method Summary collapse
-
#initialize(topCategory, source, partial) ⇒ Category
constructor
A new instance of Category.
Methods inherited from Base
Constructor Details
#initialize(topCategory, source, partial) ⇒ Category
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/twm-cms-bindings.rb', line 38 def initialize (topCategory, source, partial) @source = source; @articles = [] @sub_categories = [] @partial = partial @id = topCategory.attributes['id'].to_str @name = get_text( REXML::XPath.first( topCategory, "name" ) ) @description = get_text( REXML::XPath.first( topCategory, "description" ) ) @category_weblink = get_text( REXML::XPath.first( topCategory, "category_weblink" ) ) @article_weblink = get_text( REXML::XPath.first( topCategory, "article_weblink" ) ) if ( partial == false) @cdn_image_url = get_text( REXML::XPath.first( topCategory, "cdn_image_url" ) ) @cdn_thumbnail_url = get_text( REXML::XPath.first( topCategory, "cdn_thumbnail_url" ) ) REXML::XPath.each( topCategory, "subcategories/category") {|subCategory| @sub_categories << CMSBinding::Category.new( subCategory, source, true ) } REXML::XPath.each( topCategory, "articles/article" ) {|article| @articles << CMSBinding::Article.new( article, source, true ) } end end |
Instance Attribute Details
#article_weblink ⇒ Object (readonly)
Returns the value of attribute article_weblink.
34 35 36 |
# File 'lib/twm-cms-bindings.rb', line 34 def article_weblink @article_weblink end |
#articles ⇒ Object (readonly)
Returns the value of attribute articles.
34 35 36 |
# File 'lib/twm-cms-bindings.rb', line 34 def articles @articles end |
#category_weblink ⇒ Object (readonly)
Returns the value of attribute category_weblink.
34 35 36 |
# File 'lib/twm-cms-bindings.rb', line 34 def category_weblink @category_weblink end |
#cdn_image_url ⇒ Object (readonly)
Returns the value of attribute cdn_image_url.
34 35 36 |
# File 'lib/twm-cms-bindings.rb', line 34 def cdn_image_url @cdn_image_url end |
#cdn_thumbnail_url ⇒ Object (readonly)
Returns the value of attribute cdn_thumbnail_url.
34 35 36 |
# File 'lib/twm-cms-bindings.rb', line 34 def cdn_thumbnail_url @cdn_thumbnail_url end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
34 35 36 |
# File 'lib/twm-cms-bindings.rb', line 34 def description @description end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
34 35 36 |
# File 'lib/twm-cms-bindings.rb', line 34 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
34 35 36 |
# File 'lib/twm-cms-bindings.rb', line 34 def name @name end |
#parent ⇒ Object (readonly)
Returns the value of attribute parent.
34 35 36 |
# File 'lib/twm-cms-bindings.rb', line 34 def parent @parent end |
#sub_categories ⇒ Object (readonly)
Returns the value of attribute sub_categories.
34 35 36 |
# File 'lib/twm-cms-bindings.rb', line 34 def sub_categories @sub_categories end |