Class: Wechat::Message::ArticleBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/wechat/message.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeArticleBuilder

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

#itemsObject (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