Module: Eapi::Methods::Properties::ClassMethods

Included in:
Common::ClassMethods
Defined in:
lib/eapi/methods/properties.rb

Instance Method Summary collapse

Instance Method Details

#default_value_for(property) ⇒ Object



111
112
113
# File 'lib/eapi/methods/properties.rb', line 111

def default_value_for(property)
  definition_for(property).fetch(:default, nil)
end

#default_value_for?(property) ⇒ Boolean



107
108
109
# File 'lib/eapi/methods/properties.rb', line 107

def default_value_for?(property)
  definition_for(property).key? :default
end

#definition_for(field) ⇒ Object



83
84
85
# File 'lib/eapi/methods/properties.rb', line 83

def definition_for(field)
  _property_definitions.fetch(field.to_sym, {}).dup
end

#ignore_definition(field) ⇒ Object



103
104
105
# File 'lib/eapi/methods/properties.rb', line 103

def ignore_definition(field)
  definition_for(field).fetch(:ignore, :nil?)
end

#propertiesObject



79
80
81
# File 'lib/eapi/methods/properties.rb', line 79

def properties
  _property_definitions.keys
end

#property(field, definition = {}) ⇒ Object



72
73
74
75
76
77
# File 'lib/eapi/methods/properties.rb', line 72

def property(field, definition = {})
  fs = field.to_sym
  define_accessors fs
  run_property_definition fs, definition
  store_property_definition fs, definition
end

#property_allow_raw(field) ⇒ Object



60
61
62
# File 'lib/eapi/methods/properties.rb', line 60

def property_allow_raw(field)
  _property_allow_raw[field.to_sym] = true
end

#property_allow_raw?(field) ⇒ Boolean



68
69
70
# File 'lib/eapi/methods/properties.rb', line 68

def property_allow_raw?(field)
  _property_allow_raw.fetch(field.to_sym, false)
end

#property_disallow_raw(field) ⇒ Object



64
65
66
# File 'lib/eapi/methods/properties.rb', line 64

def property_disallow_raw(field)
  _property_allow_raw[field.to_sym] = false
end