Class: Riveter::Attributes::AttributeInfo
- Defined in:
- lib/riveter/attributes.rb
Instance Attribute Summary collapse
-
#converter ⇒ Object
Returns the value of attribute converter.
-
#name ⇒ Object
Returns the value of attribute name.
-
#options ⇒ Object
Returns the value of attribute options.
-
#target ⇒ Object
Returns the value of attribute target.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
Instance Attribute Details
#converter ⇒ Object
Returns the value of attribute converter
310 311 312 |
# File 'lib/riveter/attributes.rb', line 310 def converter @converter end |
#name ⇒ Object
Returns the value of attribute name
310 311 312 |
# File 'lib/riveter/attributes.rb', line 310 def name @name end |
#options ⇒ Object
Returns the value of attribute options
310 311 312 |
# File 'lib/riveter/attributes.rb', line 310 def @options end |
#target ⇒ Object
Returns the value of attribute target
310 311 312 |
# File 'lib/riveter/attributes.rb', line 310 def target @target end |
#type ⇒ Object
Returns the value of attribute type
310 311 312 |
# File 'lib/riveter/attributes.rb', line 310 def type @type end |
Instance Method Details
#default ⇒ Object
315 316 317 |
# File 'lib/riveter/attributes.rb', line 315 def default @default ||= [:default] end |
#default? ⇒ Boolean
319 320 321 |
# File 'lib/riveter/attributes.rb', line 319 def default? !self.default.nil? end |
#evaluate_default(scope) ⇒ Object
323 324 325 |
# File 'lib/riveter/attributes.rb', line 323 def evaluate_default(scope) default? && default.respond_to?(:call) ? scope.instance_exec(&default) : default end |
#required? ⇒ Boolean
311 312 313 |
# File 'lib/riveter/attributes.rb', line 311 def required? @required ||= ([:required] == true) end |