Class: Tinysky::FeedPost
- Inherits:
-
Object
- Object
- Tinysky::FeedPost
- Defined in:
- lib/tinysky/feed_post.rb
Instance Method Summary collapse
-
#initialize(text, options) ⇒ FeedPost
constructor
A new instance of FeedPost.
- #to_hash ⇒ Object
Constructor Details
#initialize(text, options) ⇒ FeedPost
Returns a new instance of FeedPost.
3 4 5 6 |
# File 'lib/tinysky/feed_post.rb', line 3 def initialize(text, ) @text = text @options = end |
Instance Method Details
#to_hash ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/tinysky/feed_post.rb', line 8 def to_hash hsh = { "$type" => Tinysky::Lexicon::FEED_POST, "createdAt" => created_at, "langs" => ["en-US"], "text" => @text } hsh["embed"] = .to_hash unless .nil? hsh["facets"] = facets.map(&:to_hash) if facets.any? hsh end |