Module: Eapi::List

Extended by:
Common
Includes:
Comparable, Enumerable
Defined in:
lib/eapi/list.rb

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.add_features(klass) ⇒ Object



13
14
15
16
17
18
# File 'lib/eapi/list.rb', line 13

def self.add_features(klass)
  Eapi::Common.add_features klass
  klass.extend(ClassMethods)
  klass.include(Eapi::Methods::Properties::ListInstanceMethods)
  klass.extend(Eapi::Methods::Properties::ListCLassMethods)
end

.extended(mod) ⇒ Object



20
21
22
23
24
# File 'lib/eapi/list.rb', line 20

def self.extended(mod)
  def mod.included(klass)
    Eapi::List.add_features klass
  end
end

.included(klass) ⇒ Object



26
27
28
# File 'lib/eapi/list.rb', line 26

def self.included(klass)
  Eapi::List.add_features klass
end

Instance Method Details

#<=>(other) ⇒ Object



47
48
49
# File 'lib/eapi/list.rb', line 47

def <=>(other)
  (_list <=> other) || (other.respond_to?(:_list) && _list <=> other._list)
end

#_listObject



38
39
40
# File 'lib/eapi/list.rb', line 38

def _list
  @_list ||= []
end

#add(value) ⇒ Object



42
43
44
45
# File 'lib/eapi/list.rb', line 42

def add(value)
  self << value
  self
end

#is_multiple?Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/eapi/list.rb', line 30

def is_multiple?
  true
end

#to_aObject



34
35
36
# File 'lib/eapi/list.rb', line 34

def to_a
  render
end