Class: Tweethook::Post
- Inherits:
-
Array
- Object
- Array
- Tweethook::Post
- Defined in:
- lib/tweethook/post.rb
Instance Attribute Summary collapse
-
#signature ⇒ Object
Returns the value of attribute signature.
-
#time ⇒ Object
Returns the value of attribute time.
Instance Method Summary collapse
-
#initialize(json) ⇒ Post
constructor
A new instance of Post.
- #valid? ⇒ Boolean
Constructor Details
#initialize(json) ⇒ Post
Returns a new instance of Post.
5 6 7 8 9 10 |
# File 'lib/tweethook/post.rb', line 5 def initialize(json) hash = json.is_a?(Hash) ? json : JSON.parse(json) @signature = hash['signature'] @time = Time.at(hash['time']) super(hash['results'].map { |result| Tweethook::Result.new(result) }) end |
Instance Attribute Details
#signature ⇒ Object
Returns the value of attribute signature.
3 4 5 |
# File 'lib/tweethook/post.rb', line 3 def signature @signature end |
#time ⇒ Object
Returns the value of attribute time.
3 4 5 |
# File 'lib/tweethook/post.rb', line 3 def time @time end |