Class: Taipu::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/taipu/base.rb

Overview

Abstract class.

Direct Known Subclasses

Array, Boolean, File, Hash, Number, String

Instance Method Summary collapse

Instance Method Details

#constraintsObject



17
18
19
# File 'lib/taipu/base.rb', line 17

def constraints
  {}
end

#to_hObject



7
8
9
10
11
# File 'lib/taipu/base.rb', line 7

def to_h
  {
    type: to_sym
  }.merge(constraints)
end

#to_symObject



13
14
15
# File 'lib/taipu/base.rb', line 13

def to_sym
  self.class.name.split('::').last.downcase.to_sym
end