Class: Genome::Core::Helpers::PropertyConfig
- Inherits:
-
Object
- Object
- Genome::Core::Helpers::PropertyConfig
- Defined in:
- lib/genome/core/helpers/property_config.rb
Instance Attribute Summary collapse
-
#nullable ⇒ Object
(also: #nullable?)
readonly
Returns the value of attribute nullable.
-
#settable ⇒ Object
(also: #settable?)
readonly
Returns the value of attribute settable.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ PropertyConfig
constructor
A new instance of PropertyConfig.
- #to_h ⇒ Object
- #valid?(property_value) ⇒ Boolean
Constructor Details
#initialize(options = {}) ⇒ PropertyConfig
Returns a new instance of PropertyConfig.
7 8 9 10 |
# File 'lib/genome/core/helpers/property_config.rb', line 7 def initialize( = {}) @settable = [:settable] @nullable = [:nullable] end |
Instance Attribute Details
#nullable ⇒ Object (readonly) Also known as: nullable?
Returns the value of attribute nullable.
5 6 7 |
# File 'lib/genome/core/helpers/property_config.rb', line 5 def nullable @nullable end |
#settable ⇒ Object (readonly) Also known as: settable?
Returns the value of attribute settable.
5 6 7 |
# File 'lib/genome/core/helpers/property_config.rb', line 5 def settable @settable end |
Instance Method Details
#to_h ⇒ Object
19 20 21 22 23 24 |
# File 'lib/genome/core/helpers/property_config.rb', line 19 def to_h { settable: settable, nullable: nullable } end |
#valid?(property_value) ⇒ Boolean
13 14 15 16 17 |
# File 'lib/genome/core/helpers/property_config.rb', line 13 def valid?(property_value) return false if !nullable && property_value == nil true end |