listly 0.1.3 → 0.1.4

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 260001fcbec50c2260f25e34237d86b4549e8ec5
4
- data.tar.gz: 494bdb187588c04fc29cc9ee0214797f5778ad31
3
+ metadata.gz: 06730e4bf6465e967b61301ae338d24863e58c6a
4
+ data.tar.gz: cfd63cdd96c7192d9a1846fc3ca723ea0c5fc692
5
5
  SHA512:
6
- metadata.gz: 54f6b6cb9631ec143ec31f5c76db9a9498461817fb34705d902f11360e8046078d5f009f97025b11bc02758a7e56086036fbcfb36290cc1c05371c3369bc649f
7
- data.tar.gz: b028e0e30cb6bafadf8571ee93853426ac2efdd5f17e74302ae7267eea7cb0bfa05ac3182cdf2d1021a88bfec41f25ca638e337b36646631faa2e9d1bcc37d26
6
+ metadata.gz: 2143ec5091d4ac1eb46602ac782b612c34e8067390c6a6059e6e4308a15574a772c706600963428d1b23e19c06f8ace9eb7e571e0aea34f6166d5776cd5a133b
7
+ data.tar.gz: 7015231ed9ebbbb9a218aeb8e6787f284efe624cf27ed5209a05d23a3c971c4d84a1b0e4d418920ea559b1473c319b5484dd8e4a89c4aa3c6151106453cdb190
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- listly (0.1.3)
4
+ listly (0.1.4)
5
5
  rails (>= 4.1.1)
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -43,7 +43,7 @@ module YourRailsApp
43
43
  class Application < Rails::Application
44
44
  ...
45
45
  config.listly.listly_store_location = :local_list_store
46
- config.listly.listly_constants_module = :local_list_constants
46
+ config.listly.listly_constants_module = :local_list_constants # <--- ModuleName as symbol
47
47
  ...
48
48
  end
49
49
  end
@@ -54,10 +54,10 @@ Here is an example of the module and some sample constants that will be turned i
54
54
 
55
55
  ```ruby
56
56
 
57
- module LocalListConstants
57
+ module LocalListConstants # <------ Module name see the symbol "listly_constants_module" above
58
58
 
59
- STATE_TYPES = :state_type_hash
60
- SEX_TYPES = :sex_type_hash
59
+ STATE_TYPES = :state_type_hash # <----- see the hash stored in locales below
60
+ SEX_TYPES = :sex_type_hash # <----- see the hash stored in locales below
61
61
 
62
62
  end
63
63
 
@@ -68,13 +68,13 @@ put the respective data relating to the above constant values.
68
68
 
69
69
  ```ruby
70
70
 
71
- states_hash: [
71
+ state_types_hash: [ # <------- Array of hashes - name corresponds to constants see above
72
72
  {code: 'act', name: 'ACT', desc: 'Australian Capital Teritory'},
73
73
  {code: 'nsw', name: 'NSW', desc: 'New South Wales'},
74
74
  {code: 'nt', name: 'NT', desc: 'Northern Teritory'},
75
75
  {code: 'qld', name: 'QLD', desc: 'Queensland'},
76
76
  ]
77
- sex_types_hash: [
77
+ sex_types_hash: [ # <------- Array of hashes - name corresponds to constants see above
78
78
  {code: 'male', name: 'Male'},
79
79
  {code: 'female', name: 'Female'},
80
80
  {code: 'notset', name: 'Not Set'}
@@ -103,7 +103,8 @@ module Wrapper
103
103
  include PageHeader
104
104
  include Mustache::FormBuilder
105
105
  include Wrapper::Person::Form
106
- include SexTypeList # <------ This is the included list module!
106
+ include SexTypes # <------ This is the included list module - see the SEX_TYPES
107
+ # constant in the LocalListConstants module above
107
108
 
108
109
  ```
109
110
 
@@ -122,6 +123,13 @@ sex_field: f.collection_select(:sex, all_sex_types, :sex_type_code, :sex_type_na
122
123
  }
123
124
  }),
124
125
 
126
+ # 'all_sex_types' --> is a listly defined method to get the whole list
127
+ # 'sex_type_code' --> is a listly defined attribute on the inner class
128
+ # 'sex_type_name' --> is a listly defined attribute on the inner class
129
+
130
+ # NB: The gem creates attributes from the names of the hash codes and gives the attributes
131
+ # values according to the hash values - i.e. from the data in the i18n stored array of hashes!
132
+
125
133
  ```
126
134
 
127
135
  ## Development
@@ -1,3 +1,3 @@
1
1
  module Listly
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: listly
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steve Forkin