Code Monkey home page Code Monkey logo

atheme-ruby's People

Contributors

flauschbaellchen avatar

Stargazers

 avatar

Watchers

 avatar  avatar

atheme-ruby's Issues

Attributes of entities do not update until refetch/reinitialize of the whole object

If you change one or more attributes of an entity, e.g. a channel, it won't be synced with the object itself.
Example:

@session.chanserv.info("#opers") do |channel|
  channel.url                     #=> nil
  channel.url!("www.example.com") #=> Sets an url for the channel
  channel.url                     #=> nil
end

# or

channel = @session.chanserv.info("#opers")
channel.url                     #=> nil
channel.url!("www.example.com")
channel.url                     #=> nil

# but (as the object is fetched and initialized again):

@session.chanserv.info("#opers").url #=> nil
@session.chanserv.info("#opers").url!("www.example.com")
@session.chanserv.info("#opers").url #=> www.example.com

Sure, there are some workarounds which would fix this..
But they would mess up the code.
I'll leave it as it is until I have a really good idea or decide to put up one of the workarounds. (Ideas welcome!)

Hooks

Allow developers to assign hooks to particular methods like:

hook_on :chanserv, :info do
  log "Someone asked for the info of channel X"
end

Get rid of instance_eval/method_missing steps

Currently all service-calls are simple fallbacks to a #method_missing which handles the call to the API.
In addition the parser-blocks are called with #instance_eval.
This is slow and not really a code someone would really love.

Solution:
Get rid of it and implement all methods to the respective service-classes.
Use method_missing only as the last fallback.
This will allow us to:

  • get an improvement in performance and in code-style
  • write a better documentation for each method
  • implement different return values and handlings of parsers more easily
  • implement aliases like chanserv#info, chanserv#channel
  • implement #2 easier

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.