Method: ADN::Post#initialize

Defined in:
lib/adn/post.rb

#initialize(raw_post) ⇒ Post

Returns a new instance of Post.



25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/adn/post.rb', line 25

def initialize(raw_post)
  if raw_post.respond_to?(:each_pair)
    set_values(raw_post)
    post_id = id
  else
    post_id = raw_post
    post_details = details
    if post_details.has_key? "data"
      set_values(post_details["data"])
    end
  end
end