meteor 0.9.30 → 0.9.32

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.
@@ -15,9 +15,9 @@ module Meteor
15
15
  def initialize(*args)
16
16
  case args.length
17
17
  when ZERO
18
- initialize_0
18
+ initialize_zero
19
19
  when ONE
20
- initialize_1(args[0])
20
+ initialize_one(args[0])
21
21
  else
22
22
  raise ArgumentError
23
23
  end
@@ -26,24 +26,24 @@ module Meteor
26
26
  #
27
27
  # initializer (イニシャライザ)
28
28
  #
29
- def initialize_0
30
- @map = Hash.new
29
+ def initialize_zero
30
+ @map = {}
31
31
  @recordable = false
32
32
  end
33
33
 
34
- private :initialize_0
34
+ private :initialize_zero
35
35
 
36
36
  #
37
37
  # initializer (イニシャライザ)
38
38
  # @param [Meteor::AttributeMap] attr_map attribute map (属性マップ)
39
39
  #
40
- def initialize_1(attr_map)
40
+ def initialize_one(attr_map)
41
41
  # @map = Marshal.load(Marshal.dump(attr_map.map))
42
42
  @map = attr_map.map.dup
43
43
  @recordable = attr_map.recordable
44
44
  end
45
45
 
46
- private :initialize_1
46
+ private :initialize_one
47
47
 
48
48
  #
49
49
  # set a couple of attribute name and attribute value (属性名と属性値を対としてセットする)
@@ -86,9 +86,9 @@ module Meteor
86
86
  # @return [String] attribute value (属性値)
87
87
  #
88
88
  def fetch(name)
89
- if @map[name] && !@map[name].removed
90
- @map[name].value
91
- end
89
+ return unless @map[name] && !@map[name].removed
90
+
91
+ @map[name].value
92
92
  end
93
93
 
94
94
  #
@@ -96,10 +96,10 @@ module Meteor
96
96
  # @param name attribute name (属性名)
97
97
  #
98
98
  def delete(name)
99
- if @recordable && @map[name]
100
- @map[name].removed = true
101
- @map[name].changed = false
102
- end
99
+ return unless @recordable && @map[name]
100
+
101
+ @map[name].removed = true
102
+ @map[name].changed = false
103
103
  end
104
104
 
105
105
  #
@@ -107,9 +107,9 @@ module Meteor
107
107
  # @return [true,false] update flag of attribute (属性の変更状況)
108
108
  #
109
109
  def changed(name)
110
- if @map[name]
111
- @map[name].changed
112
- end
110
+ return unless @map[name]
111
+
112
+ @map[name].changed
113
113
  end
114
114
 
115
115
  #
@@ -117,13 +117,12 @@ module Meteor
117
117
  # @return [true,false] delete flag of attribute (属性の削除状況)
118
118
  #
119
119
  def removed(name)
120
- if @map[name]
121
- @map[name].removed
122
- end
120
+ return unless @map[name]
121
+
122
+ @map[name].removed
123
123
  end
124
124
 
125
- attr_accessor :map
126
- attr_accessor :recordable
125
+ attr_accessor :map, :recordable
127
126
 
128
127
  #
129
128
  # set a couple of attribute name and attribute value (属性名と属性値を対としてセットする)