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
package main | |
import "fmt" | |
import "encoding/json" | |
type Foo struct { | |
Foo string | |
Body interface{} | |
} |
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
package main | |
import "fmt" | |
type Foo struct { | |
Payload string | |
} | |
type Bar struct { | |
Foo |
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
package main | |
import ( | |
"net/http" | |
"net/http/httptest" | |
) | |
type FooRequest struct { | |
Payload string | |
} |
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
package main | |
import "fmt" | |
import "encoding/json" | |
type Versions struct { | |
versions []int | |
} | |
func (v Versions) First() int { |
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
import sys | |
class MyClass: | |
"""A simple example class""" | |
def foo(self): | |
return 'foo meth' | |
def bar(self): | |
return 'bar meth' |
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
module Foo | |
def foo | |
super | |
puts "super" | |
end | |
end | |
module Baz | |
def foo | |
puts "foo" |
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
# global obj instance (instance of Object class) | |
puts self | |
# instance of class Class, so we can have objects of this class | |
class Klass | |
@foo = 'bar' | |
puts self #(Klass itself) | |
# we create instance method | |
# or (more precisly) method in current self | |
def foo |
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
package main | |
import ( | |
"net/http" | |
"bytes" | |
"bufio" | |
"net/http/httputil" | |
"fmt" | |
"log" |
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
# self | |
class Foo | |
# self | |
# belongs_to | |
def Foo.foo | |
@bla = '123' | |
puts 'bla' | |
end |
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
module A | |
class Foo | |
def foo | |
puts 'foo' | |
end | |
end | |
end | |
module B | |
include A |