selfies 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +48 -5
  3. data/lib/selfies/version.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4668ca50ebc03f87c8c340f78d394a457c2a5800
4
- data.tar.gz: ed7d0ed51245ad07e5b590c84e1c09096ef761ca
3
+ metadata.gz: 0b6804ef3c20e8b2da7b66a7eedb281dcb916614
4
+ data.tar.gz: ff9a72cca796a7887f4886f528316e7d500ef3f7
5
5
  SHA512:
6
- metadata.gz: ace5aa5349bace0083fec92edf463fd0ab7e92778da26bbfb3025c3f99a2871aa1724cd8eb65bfd0671715dcab5e84f49174222a301ba77c686f59f03efd4c60
7
- data.tar.gz: c63024830a0f907a15ea805ff0a0b731fef144bb59d0f1593317d2a3e4d1d1d081dc3c9c219fb4f96e19e303a7aeffe0356e3d6b05b7351c3b4c3d1120f69079
6
+ metadata.gz: 43d17ed4e3ba64e58b6f6051091525cd906f1f4c88eb9fe01f42ab7b22bda4b5a8ab6fcbe322acd291b5c89e87e9e08eaf50f52ba3b9f8e7cec7b4acb3f82d8a
7
+ data.tar.gz: f0ba4aba97b195398efccc335dd4339d4e7c83890fd0874c72105eadbcb4a101af892f9b27c8db3fc9e09dbb5a0abcc16964fef77b57f4991c235de6f890c757
data/README.md CHANGED
@@ -1,8 +1,20 @@
1
- [![CircleCI](https://circleci.com/gh/mariodarco/selfiesi/tree/master.svg?style=shield)](https://circleci.com/gh/mariodarco/selfies/tree/master)
1
+ [![CircleCI](https://circleci.com/gh/mariodarco/selfies/tree/master.svg?style=shield)](https://circleci.com/gh/mariodarco/selfies/tree/master)
2
2
 
3
3
  # Selfies
4
+ **A collection of macros for quicker development**
5
+
6
+ Another day at work, or on your personal project, and you need to create yet another class, which comes with the user boilerplate:
7
+ - The initialiser needs to be defined, with n parameters
8
+ - Inside that, the usual ```@param = param```, multiplied for how many params you've got there
9
+ - Then it's the turn of the attr_reader for those parameters
10
+ - Then you are likely to need a class method that does nothing else than initialising the class and calling an instance method of the same name
11
+ - more?
12
+
13
+ This gets boring with the years. So boring that someone might decide to write some macros to reduce the boilerplate.
14
+
15
+ ## Disclaimer
16
+ In this project you will likely read me using both ```initialize``` and ```initialise```. I'm Italian, I learnt to code from American books and now live in UK, to me they both make sense. As a rule of thumb, it's the ```ize``` form in code and ```ise``` form everywhere else. But might mix them so bear with me. Thanks!
4
17
 
5
- A collection of macros for quicker development.
6
18
 
7
19
  ## Installation
8
20
 
@@ -14,15 +26,46 @@ gem 'selfies'
14
26
 
15
27
  And then execute:
16
28
 
17
- $ bundle
29
+ ```
30
+ $ bundle
31
+ ```
18
32
 
19
33
  Or install it yourself as:
20
34
 
21
- $ gem install selfies
35
+ ```
36
+ $ gem install selfies
37
+ ```
22
38
 
23
39
  ## Usage
24
40
 
25
- TODO: Write usage instructions here
41
+ ***self_init***: can be used to automatically generate an initialiser for your class
42
+
43
+ This code:
44
+ ```ruby
45
+ class Search
46
+ self_init :term, :page, :limit
47
+ end
48
+ ```
49
+
50
+ Is equivalent to:
51
+ ```ruby
52
+ class Search
53
+ attr_reader :term, :page, :limit
54
+
55
+ def initialize(term, page, limit)
56
+ @term = term
57
+ @page = page
58
+ @limit = limit
59
+ end
60
+ end
61
+ ```
62
+
63
+ ## Next Steps
64
+
65
+ ***self_init***:
66
+ - Implement the possibility to pass defaults
67
+ - Specify which parameters will get an attr_reader, attr_accessor or none
68
+ - Specify wich parameters on attr_reader are to consider private
26
69
 
27
70
  ## Development
28
71
 
@@ -1,3 +1,3 @@
1
1
  module Selfies
2
- VERSION = '0.1.0'
2
+ VERSION = '0.1.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: selfies
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mario D’Arco