Class: Recliner::Set

Inherits:
Array show all
Defined in:
lib/recliner/properties/set.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.[](*values) ⇒ Object



73
74
75
# File 'lib/recliner/properties/set.rb', line 73

def [](*values)
  super(*values.map { |i| convert_value(i) })
end

.from_couch(array) ⇒ Object



61
62
63
# File 'lib/recliner/properties/set.rb', line 61

def from_couch(array)
  self[*array.map { |i| type.from_couch(i) }]
end

.inspectObject



65
66
67
68
69
70
71
# File 'lib/recliner/properties/set.rb', line 65

def inspect
  if self == Set
    super
  else
    "#<Set[#{type}]>"
  end
end

Instance Method Details

#+(other_array) ⇒ Object



82
83
84
# File 'lib/recliner/properties/set.rb', line 82

def +(other_array)
  self.class[*super(other_array.map { |i| convert_value(i) })]
end

#<<(obj) ⇒ Object



86
87
88
# File 'lib/recliner/properties/set.rb', line 86

def <<(obj)
  super(convert_value(obj))
end

#[]=(index, value) ⇒ Object



78
79
80
# File 'lib/recliner/properties/set.rb', line 78

def []=(index, value)
  super(index, convert_value(value))
end

#concat(other_array) ⇒ Object



90
91
92
# File 'lib/recliner/properties/set.rb', line 90

def concat(other_array)
  super(other_array.map { |i| convert_value(i) })
end

#delete(obj) ⇒ Object



94
95
96
# File 'lib/recliner/properties/set.rb', line 94

def delete(obj)
  super(convert_value(obj))
end

#index(obj) ⇒ Object



98
99
100
# File 'lib/recliner/properties/set.rb', line 98

def index(obj)
  super(convert_value(obj))
end

#insert(index, obj) ⇒ Object



102
103
104
# File 'lib/recliner/properties/set.rb', line 102

def insert(index, obj)
  super(index, convert_value(obj))
end

#push(*values) ⇒ Object



106
107
108
# File 'lib/recliner/properties/set.rb', line 106

def push(*values)
  super(*values.map { |i| convert_value(i) })
end

#rindex(obj) ⇒ Object



110
111
112
# File 'lib/recliner/properties/set.rb', line 110

def rindex(obj)
  super(convert_value(obj))
end

#unshift(*values) ⇒ Object



114
115
116
# File 'lib/recliner/properties/set.rb', line 114

def unshift(*values)
  super(*values.map { |i| convert_value(i) })
end