Class: Boba::Options::AssociationTypeOption
- Inherits:
-
T::Enum
- Object
- T::Enum
- Boba::Options::AssociationTypeOption
- Defined in:
- lib/boba/options/association_type_option.rb
Class Method Summary collapse
-
.from_options(options, &block) ⇒ Object
: ( | Hash[String, untyped] options | ) { (String value, AssociationTypeOption default_association_type_option) -> void } -> AssociationTypeOption.
Instance Method Summary collapse
-
#nilable? ⇒ Boolean
: -> bool.
-
#persisted? ⇒ Boolean
: -> bool.
Class Method Details
.from_options(options, &block) ⇒ Object
: ( | Hash[String, untyped] options | ) { (String value, AssociationTypeOption default_association_type_option) -> void } -> AssociationTypeOption
16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/boba/options/association_type_option.rb', line 16 def (, &block) association_type_option = Nilable value = ["ActiveRecordAssociationTypes"] if value if has_serialized?(value) association_type_option = from_serialized(value) else block.call(value, association_type_option) end end association_type_option end |
Instance Method Details
#nilable? ⇒ Boolean
: -> bool
38 39 40 |
# File 'lib/boba/options/association_type_option.rb', line 38 def nilable? self == AssociationTypeOption::Nilable end |
#persisted? ⇒ Boolean
: -> bool
33 34 35 |
# File 'lib/boba/options/association_type_option.rb', line 33 def persisted? self == AssociationTypeOption::Persisted end |