Class: Wechat::Message::ArticleBuilder
- Inherits:
-
Object
- Object
- Wechat::Message::ArticleBuilder
- Defined in:
- lib/wechat/message.rb
Instance Attribute Summary collapse
-
#items ⇒ Object
readonly
Returns the value of attribute items.
Instance Method Summary collapse
-
#initialize ⇒ ArticleBuilder
constructor
A new instance of ArticleBuilder.
- #item(title: "title", description: nil, pic_url: nil, url: nil) ⇒ Object
Constructor Details
#initialize ⇒ ArticleBuilder
Returns a new instance of ArticleBuilder.
24 25 26 |
# File 'lib/wechat/message.rb', line 24 def initialize @items=Array.new end |
Instance Attribute Details
#items ⇒ Object (readonly)
Returns the value of attribute items.
22 23 24 |
# File 'lib/wechat/message.rb', line 22 def items @items end |
Instance Method Details
#item(title: "title", description: nil, pic_url: nil, url: nil) ⇒ Object
28 29 30 |
# File 'lib/wechat/message.rb', line 28 def item title: "title", description: nil, pic_url: nil, url: nil items << {:Title=> title, :Description=> description, :PicUrl=> pic_url, :Url=> url}.reject{|k,v| v.nil? } end |