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 CHANGED
@@ -1,3 +1,6 @@
1
+ ## 0.1.4
2
+ * Rename NamedObject#visible to #hidden
3
+
1
4
  ## 0.1.3
2
5
  * Add allMemberName to hierarchy
3
6
 
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[:visible] = visible if visible.present? && visible == 'false'
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
@@ -56,9 +56,9 @@ module ::Rubiks
56
56
  @description ||= @options[:description]
57
57
  end
58
58
 
59
- def visible(new_value=nil)
60
- @visible = new_value.to_s unless new_value.nil?
61
- @visible ||= @options.key?(:visible) ? @options[:visible].to_s : nil
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[:visible] = visible if visible.present? && visible == 'false'
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
@@ -1,3 +1,3 @@
1
1
  module ::Rubiks
2
- VERSION = '0.1.3'
2
+ VERSION = '0.1.4'
3
3
  end
@@ -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
@@ -8,5 +8,5 @@ shared_examples 'a named object' do
8
8
  it { should respond_to :name }
9
9
  it { should respond_to :caption }
10
10
  it { should respond_to :description }
11
- it { should respond_to :visible }
11
+ it { should respond_to :hidden }
12
12
  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.3
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-26 00:00:00.000000000 Z
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: -1824235013384327224
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: -1824235013384327224
177
+ hash: 4403990775646044105
178
178
  requirements: []
179
179
  rubyforge_project:
180
180
  rubygems_version: 1.8.25