skn_utils 1.5.0 → 1.5.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0d94d1060b87e0556db8298ed9fb89dda65fa4df
4
- data.tar.gz: 2ede0cc2dbc2af963436c44c5b181eaa60025fab
3
+ metadata.gz: f5cfe73e125df779f79ce3be34a43d46d2dce65d
4
+ data.tar.gz: 303e5051dce3b79e74c3dd79d40dd69b36566eca
5
5
  SHA512:
6
- metadata.gz: ad1f469f0eb889515f60bc78afcac37a54a041fec3e778e9e7079908be5e32eb4cc34eacc137b5e7061470a5318b3a87ddf0623b3491379f7ff53bd754b1fb83
7
- data.tar.gz: 107f849d651e07346ca26f035f91869d44de26c526fa375d97a07fd0c201bb776dd3c4ed3373cce96a5568607db183202bf5112939f3e660e3be75455b5cca4b
6
+ metadata.gz: ba7e278c5d8e5abe20f1a16036c923257dfa4c794256462cc3798fe1d3435f223c02996c83ba14c8c6ef260c2920507468e9ac5c4f44301f146da9026337f2d7
7
+ data.tar.gz: 3bf125a79c73587edd42526e23f65106b6146c90c804bc70e70bf328a31cc3aa2808bd79eab49589ae83310e95237e471e66a672b9218077952495c0cd077853
data/README.md CHANGED
@@ -1,10 +1,12 @@
1
1
  [![Gem Version](https://badge.fury.io/rb/skn_utils.svg)](http://badge.fury.io/rb/skn_utils)
2
2
 
3
3
  # SknUtils
4
- Rails Gem containing a Ruby PORO (Plain Old Ruby Object) that can be instantiated at runtime with an input hash. This library creates an Object with instance variables and associated getters and setters for Dot or Hash notational access to each instance variable. Additional instance variables can be added post-create by 'obj.my_new_var = "some value"', or simply assigning it.
4
+ Rails Gem containing a Ruby PORO (Plain Old Ruby Object) that can be instantiated at runtime with an input hash. This library creates
5
+ an Object with instance variables and associated getters and setters for Dot or Hash notational access to each instance variable. Additional
6
+ instance variables can be added post-create by 'obj.my_new_var = "some value"', or simply assigning it.
5
7
 
6
8
 
7
- The intent of this component is to be a container of data results, with easy access to its contents with on-demand transformation to hash, xml, or json.
9
+ The intent of this gem is to be a container of data results, with easy access to its contents with on-demand transformation to hash, xml, or json.
8
10
 
9
11
  * If the key's value is also a hash, it too can optionally become an Object.
10
12
  * if the key's value is a Array of Hashes, each element of the Array can optionally become an Object.
data/README.rdoc CHANGED
@@ -1,10 +1,12 @@
1
1
  [![Gem Version](https://badge.fury.io/rb/skn_utils.svg)](http://badge.fury.io/rb/skn_utils)
2
2
 
3
3
  = SknUtils
4
- Rails Gem containing a Ruby PORO (Plain Old Ruby Object) that can be instantiated at runtime with an input hash. This library creates an Object with instance variables and associated getters and setters for Dot or Hash notational access to each instance variable. Additional instance variables can be added post-create by 'obj.my_new_var = "some value"', or simply assigning it.
4
+ Rails Gem containing a Ruby PORO (Plain Old Ruby Object) that can be instantiated at runtime with an input hash. This library creates
5
+ an Object with instance variables and associated getters and setters for Dot or Hash notational access to each instance variable. Additional
6
+ instance variables can be added post-create by 'obj.my_new_var = "some value"', or simply assigning it.
5
7
 
6
8
 
7
- The intent of this component is to be a container of data results, with easy access to its contents with on-demand transformation to hash, xml, or json.
9
+ The intent of this gem is to be a container of data results, with easy access to its contents with on-demand transformation to hash, xml, or json.
8
10
 
9
11
  * If the key's value is also a hash, it too can optionally become an Object.
10
12
  * if the key's value is a Array of Hashes, each element of the Array can optionally become an Object.
@@ -31,9 +31,9 @@ module SknUtils
31
31
 
32
32
  # return a hash of all attributes and their current values
33
33
  # including nested arrays of hashes/objects
34
- def attributes
34
+ def attributes(filter_internal=true)
35
35
  instance_variable_names.each_with_object({}) do |attr,collector|
36
- next if ['skn_enable_serialization', 'skn_enabled_depth'].include?(attr.to_s[1..-1]) # skip control keys
36
+ next if ['skn_enable_serialization', 'skn_enabled_depth'].include?(attr.to_s[1..-1]) and filter_internal # skip control keys
37
37
  value = instance_variable_get(attr)
38
38
  next if value.is_a?(ActiveModel::Errors)
39
39
 
@@ -61,12 +61,6 @@ module SknUtils
61
61
  send("#{attr}=", value)
62
62
  end
63
63
 
64
- # determines if this is one of our objects
65
- #:nodoc:
66
- def attribute_helper_object
67
- true
68
- end
69
-
70
64
  ##
71
65
  # DO NOT ADD METHODS BELOW THIS LINE, unless you want them to be private
72
66
  ##
@@ -75,12 +69,12 @@ module SknUtils
75
69
  # answering for any attr that method missing actually handle
76
70
  #:nodoc:
77
71
  def respond_to_missing?(method, incl_private=false)
78
- instance_variable_names.include?("@#{method.to_s}")
72
+ instance_variable_names.include?("@#{method.to_s}") || super(method,incl_private)
79
73
  end
80
74
 
81
75
  private
82
76
 
83
- # Deals with the true presence of a attribute and then its non-blank and empty value
77
+ # Deals with the true existance of an attribute and then its non-blank or empty value
84
78
  # - attribute must exist and have a non-blank value to cause this method to return true
85
79
  #:nodoc:
86
80
  def attribute?(attr)
@@ -217,6 +217,12 @@ module SknUtils
217
217
  @skn_enabled_depth
218
218
  end
219
219
 
220
+ # determines if this is one of our objects
221
+ #:nodoc:
222
+ def attribute_helper_object
223
+ true
224
+ end
225
+
220
226
  # Some keys have chars not suitable for symbol keys
221
227
  #:nodoc:
222
228
  def clean_key(original)
@@ -1,3 +1,3 @@
1
1
  module SknUtils
2
- VERSION = "1.5.0"
2
+ VERSION = "1.5.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: skn_utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Scott Jr
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-20 00:00:00.000000000 Z
11
+ date: 2015-06-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel