This file contains hidden or 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
from unittest.mock import Mock | |
thing = Mock() | |
thing | |
thing.any() | |
thing.foo |
This file contains hidden or 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 python | |
"""Let's audit Data Studio resources and permissions!""" | |
import logging | |
import os.path | |
import sys | |
from dataclasses import dataclass | |
from pathlib import Path |
This file contains hidden or 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
# coding: utf-8 | |
lib = File.expand_path('../lib', __FILE__) | |
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) | |
require 'example_gem/version' | |
Gem::Specification.new do |spec| | |
spec.name = "example_gem" | |
spec.version = ExampleGem::VERSION | |
spec.authors = ["your_name"] | |
spec.email = ["your_email@email.com"] |
This file contains hidden or 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
# Getters | |
class Person | |
attr_reader :name, :age, :occupation, :mood | |
def initialize | |
@name = "Jeffrey" | |
@age = 18 | |
@occupation = "janitor" |
This file contains hidden or 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
# Person Constructor | |
class Person | |
def initialize | |
@name = "Jeffrey" | |
@age = 18 | |
@occupation = "janitor" | |
@mood = "testy" | |
end |
This file contains hidden or 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
# Person Constructor | |
class Person | |
def initialize | |
@name = "Jeffrey" | |
@age = 18 | |
@occupation = "janitor" | |
@mood = "testy" | |
end |
This file contains hidden or 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
# Person | |
class Person | |
def call(name) | |
@name = name | |
end | |
def measure(years) | |
@age = years | |
end |
This file contains hidden or 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
# Calculator | |
class Calculator | |
def double(number) | |
number * 2 | |
end | |
def add(number1, number2) | |
number1 + number2 |
This file contains hidden or 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
# New car and the return value | |
class Car | |
def new_car | |
[] | |
end | |
def steering | |
"wheels" |
This file contains hidden or 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
class Ninja | |
def speak | |
puts "From the shadows, I strike." | |
end | |
def vanish | |
puts "poof" | |
end | |
NewerOlder