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

#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:



77
78
79
# File 'lib/vedeu/views/value.rb', line 77

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.



82
83
84
# File 'lib/vedeu/views/value.rb', line 82

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.



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

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.



95
96
97
# File 'lib/vedeu/views/value.rb', line 95

def entity
  self.class.entity_klass
end

#parent?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:



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

def parent?
  present?(parent)
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.



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

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)


111
112
113
# File 'lib/vedeu/views/value.rb', line 111

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:



119
120
121
# File 'lib/vedeu/views/value.rb', line 119

def value?
  value.any?
end