Module: ClassKit::CustomType

Defined in:
lib/class_kit/custom_type.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



3
4
5
# File 'lib/class_kit/custom_type.rb', line 3

def self.included(base)
  base.extend(CustomType)
end

.parse_assign(_value) ⇒ Object

This method must return the parsed value when the class’ attribute is assigned a value

Raises:

  • (NotImplementedError)


13
14
15
# File 'lib/class_kit/custom_type.rb', line 13

def self.parse_assign(_value)
  raise NotImplementedError
end

.parse_from_hash(_value) ⇒ Object

This method must return the parsed value when from_hash is called

Raises:

  • (NotImplementedError)


8
9
10
# File 'lib/class_kit/custom_type.rb', line 8

def self.parse_from_hash(_value)
  raise NotImplementedError
end

Instance Method Details

#to_hash_valueObject

This method must return the value that will be serialised for the attribute

Raises:

  • (NotImplementedError)


18
19
20
# File 'lib/class_kit/custom_type.rb', line 18

def to_hash_value
  raise NotImplementedError
end