NorthLumberJack

Activity Graph

Page 1 of 1

2018-04-11

[01:22:04] NorthLumberJack: has joined #ruby
[03:40:55] NorthLumberJack: Quit: Page closed

2018-04-09

[02:36:48] NorthLumberJack: has joined #ruby
[03:16:42] NorthLumberJack: has joined #RubyOnRails
[03:17:50] NorthLumberJack: hey guys, best way to check if object is a active record collection?
[03:19:08] NorthLumberJack: .is_a?(ActiveRecord::Relation)
[03:21:08] NorthLumberJack: helpa: Just so I can raise an error for my method if the param is not a collection
[04:21:45] NorthLumberJack: Ping timeout: 260 seconds

2018-04-07

[14:10:58] NorthLumberJack: has joined #ruby
[14:13:08] NorthLumberJack: hello masters, I am new to metaprgramming, I am trying to make a Predictable module, when I include this module into a class I want certain methods to raise NotImplimentedError if the methods are not overwritten in the including class...
[14:13:34] NorthLumberJack: I am having a tough time figuring it out.
[14:18:10] NorthLumberJack: @havenwood https://www.pastiebin.com/5ac8d30da97b4
[14:22:20] NorthLumberJack: @havewood https://gist.github.com/JerryArns/5d62f18a480017cfa6d9240055b93a8a
[14:22:58] NorthLumberJack: @havewood thanks
[14:23:15] NorthLumberJack: are public gist a bad idea? private?
[14:24:05] NorthLumberJack: @leitz thank you sir
[15:07:05] NorthLumberJack: @havenwood So Im trying your code from https://gist.github.com/havenwood/2409d79d83dfb6a9e531094141a0d956 and its thowing errors from other modules that their methods are not available, why would that be?
[15:08:00] NorthLumberJack: im basically trying to make Rails model classes have a set of my Predicatble methods
[15:08:27] NorthLumberJack: which the rails models classes have to overwrite
[15:09:10] NorthLumberJack: and return stadardized data
[15:16:31] NorthLumberJack: @havenwood here you go https://gist.github.com/JerryArns/3a40ac8f85a97f00f2c8a2a6a9abcf8f
[15:21:03] NorthLumberJack: havenwood: oh man that example code of the crazy project just blows my mind, would take me an hr to read through.
[15:24:59] NorthLumberJack: havenwood: The only thing that Predictable is doing so far is making sure the including class is implimenting certain methods, I guess i would check their returned data for uniformity in the future
[15:32:05] NorthLumberJack: havenwood: that is beutifull, thanks, let me use it quick
[15:45:35] NorthLumberJack: havenwood: so i have to include the module after my method definitions, does that seem right?
[15:49:21] NorthLumberJack: havenwood: ok thanks
[16:01:10] NorthLumberJack: havenwood: this metaprogramming stuff is fantastic, i need to learn more
[17:44:45] NorthLumberJack: havewood: The code works greats just wanted to say thanks and had one question. When a method is not included the raise NotImplimentedError is called, why does the including class throw udefined method errors for existing class methods?
[17:45:17] NorthLumberJack: just out of interest...
[17:45:56] NorthLumberJack: but when all methods are defined then no errors are throwen
[17:54:48] NorthLumberJack: yes that is raisl
[21:13:20] NorthLumberJack: Ping timeout: 260 seconds