This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <string.h> | |
#include <sys/types.h> | |
#include <netinet/in.h> | |
#include <netinet/ip.h> | |
#include <arpa/inet.h> | |
#define BACKLOG 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
module StatusField | |
def self.included(base) | |
base.extend ClassMethods | |
end | |
module ClassMethods | |
def status_field(*args) | |
# Problem: create a class method that returns an array |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config/initializers/extensions.rb | |
ActiveRecord::Base.send(:include, StatusField) | |
ActiveRecord::Base.send(:include, SlugUrl) | |
# lib/status_field.rb | |
module StatusField | |
def self.included(base) | |
base.extend ClassMethods |