rubiks 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +3 -0
- data/lib/rubiks/level.rb +1 -1
- data/lib/rubiks/named_object.rb +4 -5
- data/lib/rubiks/version.rb +1 -1
- data/spec/rubiks/level_spec.rb +9 -0
- data/spec/support/shared_examples.rb +1 -1
- metadata +4 -4
data/CHANGELOG.md
CHANGED
data/lib/rubiks/level.rb
CHANGED
@@ -39,7 +39,7 @@ module ::Rubiks
|
|
39
39
|
def json_hash
|
40
40
|
hash = default_json_attributes
|
41
41
|
hash[:cardinality] = cardinality.to_s if cardinality.present?
|
42
|
-
hash[:
|
42
|
+
hash[:hidden] = hidden if hidden.present? && hidden == 'false'
|
43
43
|
hash[:contiguous] = contiguous if contiguous.present? && contiguous == 'true'
|
44
44
|
hash.stringify_keys!
|
45
45
|
end
|
data/lib/rubiks/named_object.rb
CHANGED
@@ -56,9 +56,9 @@ module ::Rubiks
|
|
56
56
|
@description ||= @options[:description]
|
57
57
|
end
|
58
58
|
|
59
|
-
def
|
60
|
-
@
|
61
|
-
@
|
59
|
+
def hidden(new_value=nil)
|
60
|
+
@hidden = new_value.to_s unless new_value.nil?
|
61
|
+
@hidden ||= @options.key?(:hidden) ? @options[:hidden].to_s : nil
|
62
62
|
end
|
63
63
|
|
64
64
|
def column(new_value=nil)
|
@@ -86,7 +86,7 @@ module ::Rubiks
|
|
86
86
|
:description => description,
|
87
87
|
:icon_type => icon_type
|
88
88
|
}
|
89
|
-
json_attrs[:
|
89
|
+
json_attrs[:hidden] = hidden if hidden.present? && hidden == 'true'
|
90
90
|
json_attrs.delete_if { |key,value| value.nil? }
|
91
91
|
json_attrs.stringify_keys!
|
92
92
|
end
|
@@ -97,7 +97,6 @@ module ::Rubiks
|
|
97
97
|
:name => caption,
|
98
98
|
:description => description
|
99
99
|
}
|
100
|
-
xml_attrs[:visible] = visible if visible.present? && visible == 'false'
|
101
100
|
xml_attrs.delete_if { |key,value| value.nil? }
|
102
101
|
end
|
103
102
|
alias_method :xml_hash, :default_xml_attributes
|
data/lib/rubiks/version.rb
CHANGED
data/spec/rubiks/level_spec.rb
CHANGED
@@ -17,4 +17,13 @@ describe ::Rubiks::Level do
|
|
17
17
|
|
18
18
|
its(:xml_hash) { should_not have_key :cardinality }
|
19
19
|
end
|
20
|
+
|
21
|
+
context 'when hidden' do
|
22
|
+
subject { described_class.new('default', :hidden => true) }
|
23
|
+
|
24
|
+
it 'includes the hidden attribute' do
|
25
|
+
subject.json_hash.should have_key 'hidden'
|
26
|
+
subject.json_hash['hidden'].should eq 'true'
|
27
|
+
end
|
28
|
+
end
|
20
29
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubiks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-04-
|
12
|
+
date: 2013-04-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -165,7 +165,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
165
165
|
version: '0'
|
166
166
|
segments:
|
167
167
|
- 0
|
168
|
-
hash:
|
168
|
+
hash: 4403990775646044105
|
169
169
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
170
170
|
none: false
|
171
171
|
requirements:
|
@@ -174,7 +174,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
174
174
|
version: '0'
|
175
175
|
segments:
|
176
176
|
- 0
|
177
|
-
hash:
|
177
|
+
hash: 4403990775646044105
|
178
178
|
requirements: []
|
179
179
|
rubyforge_project:
|
180
180
|
rubygems_version: 1.8.25
|