Class: Hypem::Blog
Instance Attribute Summary collapse
-
#blog_image ⇒ Object
readonly
Returns the value of attribute blog_image.
-
#blog_image_small ⇒ Object
readonly
Returns the value of attribute blog_image_small.
-
#first_posted ⇒ Object
readonly
Returns the value of attribute first_posted.
-
#followers ⇒ Object
readonly
Returns the value of attribute followers.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#last_posted ⇒ Object
readonly
Returns the value of attribute last_posted.
-
#site_name ⇒ Object
readonly
Returns the value of attribute site_name.
-
#site_url ⇒ Object
readonly
Returns the value of attribute site_url.
-
#total_tracks ⇒ Object
readonly
Returns the value of attribute total_tracks.
Class Method Summary collapse
Instance Method Summary collapse
- #get_info ⇒ Object
-
#initialize(*args) ⇒ Blog
constructor
A new instance of Blog.
Methods included from Helper
included, #update_from_response
Constructor Details
#initialize(*args) ⇒ Blog
Returns a new instance of Blog.
12 13 14 15 16 |
# File 'lib/hypem/blog.rb', line 12 def initialize(*args) if args.count == 1 @id = args.first.is_a?(Integer) ? args.first : args.first.to_i end end |
Instance Attribute Details
#blog_image ⇒ Object (readonly)
Returns the value of attribute blog_image.
5 6 7 |
# File 'lib/hypem/blog.rb', line 5 def blog_image @blog_image end |
#blog_image_small ⇒ Object (readonly)
Returns the value of attribute blog_image_small.
5 6 7 |
# File 'lib/hypem/blog.rb', line 5 def blog_image_small @blog_image_small end |
#first_posted ⇒ Object (readonly)
Returns the value of attribute first_posted.
5 6 7 |
# File 'lib/hypem/blog.rb', line 5 def first_posted @first_posted end |
#followers ⇒ Object (readonly)
Returns the value of attribute followers.
5 6 7 |
# File 'lib/hypem/blog.rb', line 5 def followers @followers end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
5 6 7 |
# File 'lib/hypem/blog.rb', line 5 def id @id end |
#last_posted ⇒ Object (readonly)
Returns the value of attribute last_posted.
5 6 7 |
# File 'lib/hypem/blog.rb', line 5 def last_posted @last_posted end |
#site_name ⇒ Object (readonly)
Returns the value of attribute site_name.
5 6 7 |
# File 'lib/hypem/blog.rb', line 5 def site_name @site_name end |
#site_url ⇒ Object (readonly)
Returns the value of attribute site_url.
5 6 7 |
# File 'lib/hypem/blog.rb', line 5 def site_url @site_url end |
#total_tracks ⇒ Object (readonly)
Returns the value of attribute total_tracks.
5 6 7 |
# File 'lib/hypem/blog.rb', line 5 def total_tracks @total_tracks end |
Class Method Details
.all ⇒ Object
24 25 26 27 |
# File 'lib/hypem/blog.rb', line 24 def self.all response = Request.get_resource("/get_all_blogs") response.map { |b| self.new.tap {|blog| blog.update_from_response(b) } } end |
Instance Method Details
#get_info ⇒ Object
18 19 20 21 22 |
# File 'lib/hypem/blog.rb', line 18 def get_info response = Request.get_resource("/get_site_info?siteid=#{id}") update_from_response(response) self end |