All Projects → onmyway133 → Construction

onmyway133 / Construction

Licence: other
👷 The many ways to construct and configure your entity

Programming Languages

swift
15916 projects
ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to Construction

SNAC
Simultaneous Navigation and Construction
Stars: ✭ 13 (-62.86%)
Mutual labels:  construction
GEstimator
GEstimator is a simple civil estimation software written in Python and GTK+. GEstimator can prepare estimates along with rate analysis and supports multiple databases.
Stars: ✭ 17 (-51.43%)
Mutual labels:  construction
spdlog setup
spdlog setup initialization via file configuration for convenience.
Stars: ✭ 68 (+94.29%)
Mutual labels:  init
init
KISS Linux - Init Framework
Stars: ✭ 85 (+142.86%)
Mutual labels:  init
4004-SBC
Home-brew Intel 4004 Single Board Computer
Stars: ✭ 18 (-48.57%)
Mutual labels:  construction
lvim
My config for LunarVim
Stars: ✭ 71 (+102.86%)
Mutual labels:  init
IsExternalInit
A source code only package which allows you to use C# 9's init and record features in older target frameworks like .NET Standard 2.0 or the "old" .NET Framework by providing a polyfill for the IsExternalInit class.
Stars: ✭ 75 (+114.29%)
Mutual labels:  init
AppRopio.Mobile
AppRopio - mobile apps builder for iOS/Android based on Xamarin
Stars: ✭ 16 (-54.29%)
Mutual labels:  constructor
tini
A tiny but valid `init` for containers
Stars: ✭ 7,757 (+22062.86%)
Mutual labels:  init
nyx
Lean linux and OSX process monitoring written in C
Stars: ✭ 24 (-31.43%)
Mutual labels:  init
online-ethereum-abi-encoder-decoder
A quick online tool to abi-encode and abi-decode constructor arguments used in ethereum's solidity. https://adibas03.github.io/online-ethereum-abi-encoder-decoder/
Stars: ✭ 37 (+5.71%)
Mutual labels:  constructor
create-colyseus-app
Template for setting up a Colyseus server.
Stars: ✭ 24 (-31.43%)
Mutual labels:  init
module-init
🏁 Create a new node module with all the right stuff.
Stars: ✭ 71 (+102.86%)
Mutual labels:  init
ediTable
Manipulation of table (sort, add, edit, remove, etc... - rows | valid cells, type, require, etc... cells )
Stars: ✭ 14 (-60%)
Mutual labels:  construction
python-autoclass
A python 3 library providing functions and decorators to automatically generate class code, such as constructor body or properties getters/setters along with optional support of validation contracts on the generated setters. Its objective is to reduce the amount of copy/paste code in your classes - and hence to help reducing human mistakes :).
Stars: ✭ 30 (-14.29%)
Mutual labels:  constructor
InitKit
Neo-InitWare is a modular, cross-platform reimplementation of the systemd init system. It is experimental.
Stars: ✭ 364 (+940%)
Mutual labels:  init
volpy
Volume Calculations for Digital Elevation Models in Python
Stars: ✭ 26 (-25.71%)
Mutual labels:  construction
kernel-syslog
📝 Kernel module that can be used as a replacement for syslog, logger or logwrapper
Stars: ✭ 37 (+5.71%)
Mutual labels:  init
ocp-flyway-db-migration
Database Migration Sample with Flyway, Docker and Kubernetes in Openshift Container Platform
Stars: ✭ 17 (-51.43%)
Mutual labels:  init
multirun
A minimalist init process designed for Docker
Stars: ✭ 85 (+142.86%)
Mutual labels:  init

Construction

The many ways to construct and configure your entity. Work for struct and class

CI Status Version Carthage Compatible License Platform

Usage

construct

  • Free function
  • Construct a struct and configure it

Person

struct Person {
  var name: String = ""
  var age: Int = 0
  var website: NSURL?

  init() {

  }
}

extension Person: Initable {}
let person: Person = construct {
  $0.name = "Luffy"
  $0.age = 17
}

XCTAssertEqual(person.name, "Luffy")
XCTAssertEqual(person.age, 17)
XCTAssertNil(person.website)

build

  • Free function
  • Build an existing struct
var person = Person() // Declare as `var`
build(&person) {      // Use `&`
  $0.name = "Luffy"
  $0.age = 17
}

XCTAssertEqual(person.name, "Luffy")
XCTAssertEqual(person.age, 17)
XCTAssertNil(person.website)
  • Build an existing object

Car

class Car {
  var model: String = ""
  var price: Int = 0
}

extension Car: Configurable {}
let car = build(Car()) {
  $0.model = "Tesla Model 3"
  $0.price = 35_000
}

XCTAssertEqual(car.model, "Tesla Model 3")
XCTAssertEqual(car.price, 35_000)

configure

  • Member function
  • Configure existing object
let car = Car().configure {
  $0.model = "Tesla Model 3"
  $0.price = 35_000
}

XCTAssertEqual(car.model, "Tesla Model 3")
XCTAssertEqual(car.price, 35_000)

Installation

Construction is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'Construction'

Construction is also available through Carthage. To install just write into your Cartfile:

github "onmyway133/Construction"

Author

Khoa Pham, [email protected]

Contributing

We would love you to contribute to Construction, check the CONTRIBUTING file for more info.

License

Construction is available under the MIT license. See the LICENSE file for more info.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].