hola_dmleobit 0.0.1 → 0.0.3

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 (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/hola_dmleobit.rb +37 -7
  3. metadata +17 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b1eb7847183ec4abaa2225794008dd89c712a50d1f12c81fce975f68c481060a
4
- data.tar.gz: ed59804cb8dd17c36044cf9e4a958daee9f0e713d49497190dbfa6a276dbe3bd
3
+ metadata.gz: 7c3f72e74961e501919b655322c69ee930f9ec6344a6ebfc9040393926132152
4
+ data.tar.gz: 3989ad3aafb34c8b4ac4f63ceba3702fb4f5f0a2d2569f54d3209da39ee59882
5
5
  SHA512:
6
- metadata.gz: f616f4a105afdcae870aab97cca71f7caec6327b200a0c6f66ce381047c3a2597fb9f9a6fff0b649c2da87684a425a45348ac3ad1c274ad21282409f8b8d9364
7
- data.tar.gz: c40eb1baa298de4b3cbfda9db63145b70de6908fc1a69ac1291e1b0dbe1491406251a5ba2a0f3c0e1c20c027375901486a98f2b208ca0f3da78c4e279e73ca88
6
+ metadata.gz: 3dcdca0b5f8ac8fe989e2eb7589518bf61a7c9b5e57f95b844273e10aa0506a1337dacbf0a5f6121b54f1d29af0a1f79136ff6f1f8c68de8118ad966aa1d8229
7
+ data.tar.gz: 73281edfee11f17180db7f0658e2e4e3326cba82b666c1052619a8f5c7cf5efcda70823a3fe82919ff1b88c7cf44e55a4e23638e2f95e6095923b6065256096b
data/lib/hola_dmleobit.rb CHANGED
@@ -1,12 +1,42 @@
1
- class HolaDmleobit
2
- def self.hi
3
- puts "Hello world!"
1
+ module HolaDmleobit
2
+ extend ActiveSupport::Concern
3
+
4
+ class_methods do
5
+ # resource_name - name of instance variable where found resource will be placed
6
+ # options includes:
7
+ # - class - name of resource class (default: taken from resource_name)
8
+ # - by - how value is named in params (default: :id)
9
+ # - attribute - name of resource attribute (default: :id)
10
+ # - strict - raise error if resource hasn't been found (default: true)
11
+ # - fallback - method name/proc which we call if resource hasn't been found
12
+ # - fallback_value - method name/proc which we call if value can't be found in params
13
+ # - only - list of controller actions on which it is triggered
14
+ # - except - list of controller actions on which it isn't triggered
15
+ # - eager_load - list of eager loaded entries to avoid N+1 problem
16
+ # - preload - list of preloaded entries to avoid N+1 problem
17
+ # - joins - list of joined entries to avoid N+1 problem
18
+ # - decorate - shows if we should decorate found resource.
19
+ # Can be used only with respective Drapper decorator
20
+ # - friendly - shows if we should find resource also by slug field.
21
+ # Can be used only for FriendlyId models.
22
+ #
23
+ def find(resource_name, **options)
24
+ ::Findable::Definition.new(
25
+ controller: self,
26
+ resource_name: resource_name,
27
+ **options
28
+ ).call
29
+ end
4
30
  end
5
31
  end
6
32
 
7
- require 'findable'
8
- require 'findable/definition'
33
+ # class HolaDmleobit
34
+ # def self.hi
35
+ # puts "Hello world!"
36
+ # end
37
+ # end
9
38
 
39
+ require 'findable/definition'
10
40
 
11
41
  # module Findable
12
42
  # extend ActiveSupport::Concern
@@ -31,11 +61,11 @@ require 'findable/definition'
31
61
  # # Can be used only for FriendlyId models.
32
62
  # #
33
63
  # def find(resource_name, **options)
34
- # ::Findable::Definition.call(
64
+ # ::Findable::Definition.new(
35
65
  # controller: self,
36
66
  # resource_name: resource_name,
37
67
  # **options
38
- # )
68
+ # ).call
39
69
  # end
40
70
  # end
41
71
  # end
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hola_dmleobit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Quaranto
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-02-16 00:00:00.000000000 Z
12
- dependencies: []
11
+ date: 2023-02-21 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: activesupport
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 4.2.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 4.2.0
13
27
  description: A simple hello world gem
14
28
  email: nick@quaran.to
15
29
  executables: []