Module: Schema::Controls::Schema

Defined in:
lib/schema/controls/schema.rb,
lib/schema/controls/schema/different.rb

Defined Under Namespace

Modules: Attributes, Boolean, Check, DefaultValue, Different, Duplicate, Equivalent, Random, TransientAttributes, Typed, Validation Classes: Example, OtherExample

Class Method Summary collapse

Class Method Details

.ancestorsObject



26
27
28
# File 'lib/schema/controls/schema.rb', line 26

def self.ancestors
  example.class.ancestors
end

.attribute_namesObject



34
35
36
# File 'lib/schema/controls/schema.rb', line 34

def self.attribute_names
  example.class.attribute_names
end

.attributesObject



30
31
32
# File 'lib/schema/controls/schema.rb', line 30

def self.attributes
  example.attributes
end

.exampleObject



4
5
6
7
8
9
# File 'lib/schema/controls/schema.rb', line 4

def self.example
  example = Example.new
  example.some_attribute = some_attribute
  example.some_other_attribute = some_other_attribute
  example
end

.hashObject



38
39
40
# File 'lib/schema/controls/schema.rb', line 38

def self.hash
  example.to_h
end

.other_exampleObject



11
12
13
14
15
16
# File 'lib/schema/controls/schema.rb', line 11

def self.other_example
  example = OtherExample.new
  example.some_attribute = some_attribute
  example.some_other_attribute = some_other_attribute
  example
end

.some_attributeObject



18
19
20
# File 'lib/schema/controls/schema.rb', line 18

def self.some_attribute
  Attribute::Value.some_attribute
end

.some_other_attributeObject



22
23
24
# File 'lib/schema/controls/schema.rb', line 22

def self.some_other_attribute
  Attribute::Value.some_other_attribute
end