simple_attribute 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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '06569cfdd5cd4f87f9d7fdb641192d4bed7d47fab33d4687cf19fc0f898a117e'
|
4
|
+
data.tar.gz: 47ec2da68ff2e219f39e85bbe69837afc625bb38dc7a32e8e97460298456e66a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3f295ff9486b5d45827bc5283df99e36008201752394a821c1aaf9630173bf8baa5bbf284fa8865e47c2c06e0de56d842760eedca5ddc3aece07f27d066a8c45
|
7
|
+
data.tar.gz: f06ef71bd2ab163e9bdde6aa6388c537c8a86f266b49ee59eb45b5afd992a8047dd74659a7275534cf4cf6597a602a77c652a7ec9d67591ab6118d42573c7c89
|
@@ -59,6 +59,11 @@ module SimpleAttribute
|
|
59
59
|
"#{attribute}".dasherize
|
60
60
|
end
|
61
61
|
|
62
|
+
# Attribute label method
|
63
|
+
def label_method
|
64
|
+
@options.fetch(:label, :to_s)
|
65
|
+
end
|
66
|
+
|
62
67
|
# Attribute html options
|
63
68
|
def html_options
|
64
69
|
options.fetch :html, {}
|
@@ -82,7 +87,7 @@ module SimpleAttribute
|
|
82
87
|
|
83
88
|
# Render attribute
|
84
89
|
def render_attribute
|
85
|
-
"#{value
|
90
|
+
"#{value.try(label_method)}".html_safe
|
86
91
|
end
|
87
92
|
|
88
93
|
# Render attribute or default
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple_attribute
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonian Guveli
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-07-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionview
|
@@ -118,6 +118,7 @@ files:
|
|
118
118
|
- lib/simple_attribute/attributes/file.rb
|
119
119
|
- lib/simple_attribute/attributes/image.rb
|
120
120
|
- lib/simple_attribute/attributes/link.rb
|
121
|
+
- lib/simple_attribute/attributes/money.rb
|
121
122
|
- lib/simple_attribute/attributes/video.rb
|
122
123
|
- lib/simple_attribute/builder.rb
|
123
124
|
- lib/simple_attribute/config.rb
|