Class: Trax::Model::Attributes::Definitions
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Trax::Model::Attributes::Definitions
- Defined in:
- lib/trax/model/attributes/definitions.rb
Instance Method Summary collapse
- #__getobj__ ⇒ Object
- #attribute(*args, type:, **options, &block) ⇒ Object
- #boolean(*args, **options, &block) ⇒ Object
- #enum(*args, **options, &block) ⇒ Object
-
#initialize(model) ⇒ Definitions
constructor
A new instance of Definitions.
- #integer(*args, **options, &block) ⇒ Object
- #string(*args, **options, &block) ⇒ Object
- #struct(*args, **options, &block) ⇒ Object
Constructor Details
#initialize(model) ⇒ Definitions
Returns a new instance of Definitions.
5 6 7 |
# File 'lib/trax/model/attributes/definitions.rb', line 5 def initialize(model) @model = model end |
Instance Method Details
#__getobj__ ⇒ Object
9 10 11 |
# File 'lib/trax/model/attributes/definitions.rb', line 9 def __getobj__ @model end |
#attribute(*args, type:, **options, &block) ⇒ Object
13 14 15 |
# File 'lib/trax/model/attributes/definitions.rb', line 13 def attribute(*args, type:, **, &block) @model.trax_attribute(*args, type: type, **, &block) end |
#boolean(*args, **options, &block) ⇒ Object
17 18 19 |
# File 'lib/trax/model/attributes/definitions.rb', line 17 def boolean(*args, **, &block) attribute(*args, :type => :boolean, **, &block) end |
#enum(*args, **options, &block) ⇒ Object
21 22 23 |
# File 'lib/trax/model/attributes/definitions.rb', line 21 def enum(*args, **, &block) attribute(*args, type: :enum, **, &block) end |
#integer(*args, **options, &block) ⇒ Object
25 26 27 |
# File 'lib/trax/model/attributes/definitions.rb', line 25 def integer(*args, **, &block) attribute(*args, type: :integer, **, &block) end |
#string(*args, **options, &block) ⇒ Object
29 30 31 |
# File 'lib/trax/model/attributes/definitions.rb', line 29 def string(*args, **, &block) attribute(*args, :type => :string, **, &block) end |
#struct(*args, **options, &block) ⇒ Object
33 34 35 |
# File 'lib/trax/model/attributes/definitions.rb', line 33 def struct(*args, **, &block) attribute(*args, :type => :json, **, &block) end |