Module: XMLable::Mixins::ValueStorage

Defined in:
lib/xmlable/mixins/value_storage.rb

Overview

ValueStorage modules contains the logic to manage XML attributes values

Instance Method Summary collapse

Instance Method Details

#__empty?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.

Is this element empty?

Returns:

  • (Boolean)


71
72
73
74
# File 'lib/xmlable/mixins/value_storage.rb', line 71

def __empty?
  return false unless super
  __empty(__value)
end

#__objectObject

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.

Get unwraped attribute object’s value

Returns:



48
49
50
# File 'lib/xmlable/mixins/value_storage.rb', line 48

def __object
  __value
end

#__overwrite_value(val) ⇒ Object

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.

Overwrite XML attribute’s value

Parameters:



36
37
38
39
# File 'lib/xmlable/mixins/value_storage.rb', line 36

def __overwrite_value(val)
  @__node.content = __export_to_xml(val)
  self.__value = val
end

#__set_value(node) ⇒ Object

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.

Set XML attribute value

Parameters:

  • node (Nokogiri::XML::Attr)

    XML attribute node



14
15
16
# File 'lib/xmlable/mixins/value_storage.rb', line 14

def __set_value(node)
  self.__value = __cast(node.content)
end

#__valueObject

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.

Get attribute value

Returns:



60
61
62
# File 'lib/xmlable/mixins/value_storage.rb', line 60

def __value
  @__value
end

#__value=(val) ⇒ Object

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.

Set value

Parameters:



25
26
27
# File 'lib/xmlable/mixins/value_storage.rb', line 25

def __value=(val)
  @__value = val
end

#to_sString

Returns:

  • (String)


79
80
81
# File 'lib/xmlable/mixins/value_storage.rb', line 79

def to_s
  __value.to_s
end