Module: Vedeu::Views::Value::InstanceMethods Private

Includes:
Common
Defined in:
lib/vedeu/views/value.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Provide additional behaviour as instance methods to the including class or module.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Common

#absent?, #array?, #boolean, #boolean?, #empty_value?, #escape?, #falsy?, #hash?, #line_model?, #numeric?, #positionable?, #present?, #snake_case, #stream_model?, #string?, #symbol?, #truthy?, #view_model?

Instance Attribute Details

#clientvoid

This method returns an undefined value.

The client binding represents the client application object that is currently invoking a DSL method. It is required so that we can send messages to the client application object should we need to.



70
71
72
# File 'lib/vedeu/views/value.rb', line 70

def client
  @client
end

#parentvoid

This method returns an undefined value.



74
75
76
# File 'lib/vedeu/views/value.rb', line 74

def parent
  @parent
end

Instance Method Details

#add(child) ⇒ Vedeu::Views Also known as: <<

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Adds the child to the collection.

Parameters:

Returns:



80
81
82
# File 'lib/vedeu/views/value.rb', line 80

def add(child)
  @value = value.add(child)
end

#client?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:



86
87
88
# File 'lib/vedeu/views/value.rb', line 86

def client?
  present?(client)
end

#collectionvoid

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method returns an undefined value.



91
92
93
# File 'lib/vedeu/views/value.rb', line 91

def collection
  self.class.collection_klass
end

#deputyvoid

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method returns an undefined value.

Returns a DSL instance responsible for defining the DSL methods of this model.



99
100
101
# File 'lib/vedeu/views/value.rb', line 99

def deputy
  self.class.deputy_klass.new(self, client)
end

#entityvoid

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method returns an undefined value.



104
105
106
# File 'lib/vedeu/views/value.rb', line 104

def entity
  self.class.entity_klass
end

#valuevoid

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method returns an undefined value.



109
110
111
# File 'lib/vedeu/views/value.rb', line 109

def value
  collection.coerce(@value || [], self)
end

#value=(value) ⇒ void

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method returns an undefined value.

Parameters:

  • value (void)


115
116
117
# File 'lib/vedeu/views/value.rb', line 115

def value=(value)
  @value = collection.coerce(value, self)
end

#value?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a boolean indicating whether this model has a non-empty value.

Returns:



123
124
125
# File 'lib/vedeu/views/value.rb', line 123

def value?
  value.any?
end