Ruby Programming Tutorial - Lesson 44 - EasySteem Api update

in ruby •  7 years ago  (edited)

I was playing with Radiator gem

Created this module called EasySteem in order to play with steem blockchain, I came up with a little bit, better organization this time, keeping all related methods in separate modules.

EasySteem

You see there is a plenty of room, to fill more modules later on :)
Screenshot from 2018-04-02 22-15-46.png

so There is a bigger module which is called EasySteem, that contains two modules inside of it

  • Account module
  • Stream module

later on, I can extend it to add more modules :) for now. lets see what methods these two modules provides to you

Screenshot from 2018-04-03 00-43-07.png

Account module

require_relative 'easysteem'

## Show virtual Steem supply
puts EasySteem::Account.supply

## Get 10 followers of bilal-haider
puts EasySteem::Account.followers "bilal-haider", 10

## Get 10 people who are followed by bilal-haider
puts EasySteem::Account.following "bilal-haider", 10

At the moment, Accoutn module has only 3 methods :) But later I can add more, when i see some method fits in this place.
Now here is Second module, which I called Stream module. and it has few methods which you can use to stream operations.

Stream module

## Stream all operations
puts EasySteem::Stream.all

## Stream all voting operations
puts EasySteem::Stream.voting_stream

## Stream all Commenting operations
puts EasySteem::Stream.comment_stream

## Stream all following operations
puts EasySteem::Stream.follow_stream

## Stream all resteem operations
puts EasySteem::Stream.reblog_stream

## Stream all transfer operations
puts EasySteem::Stream.transfer_stream

## Stream all claim reward operations
puts EasySteem::Stream.claim_rewards_stream

## Stream all account updating operations
puts EasySteem::Stream.update_account_stream

for example if you wish to see all the delegation operations, you can do so by calling appropriate method mentioned above :)

Screenshot from 2018-04-02 21-28-46.png

Or if you want to see, who is updating their accounts, you can do so by calling appropriate method as mentioned above.
in order to make this methods work..

Screenshot from 2018-04-02 21-41-57.png

I have not published my gem yet, I want to add more methods in it, once I have decent amount of methods in it. I can then go ahead and pusblish my gem, so that everyone can take benefit from it :)
Special thanks to @inertia for providing me such an awesome radiator gem :) <3 I cant' say enough thanks for that. made my life 100x easier :)

feel free to share your reviews on this in comments below :)

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

very good ideas and useful, always successful. thank you very much for sharing.

are you a programmer ?

sorry, I am not a programmer but an ordinary woman. I think the program would be very useful.

ok thanks for commenting anyway :)

thank you very much for supporting and replying to my comment ☺️

Hi, I just followed you :-)
Follow back and we can help each other succeed! @bitcoinfilter

Thanks :) I followed

programs that are very interesting and useful, hopefully quickly completed and in its publication. thank you for sharing his information.

This post has been randomly selected and resteemed @steemeely
Good luck and have a great day.