Class: Riveter::Attributes::AttributeInfo

Inherits:
Struct
  • Object
show all
Defined in:
lib/riveter/attributes.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#converterObject

Returns the value of attribute converter

Returns:

  • (Object)

    the current value of converter



307
308
309
# File 'lib/riveter/attributes.rb', line 307

def converter
  @converter
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



307
308
309
# File 'lib/riveter/attributes.rb', line 307

def name
  @name
end

#optionsObject

Returns the value of attribute options

Returns:

  • (Object)

    the current value of options



307
308
309
# File 'lib/riveter/attributes.rb', line 307

def options
  @options
end

#typeObject

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



307
308
309
# File 'lib/riveter/attributes.rb', line 307

def type
  @type
end

Instance Method Details

#defaultObject



312
313
314
# File 'lib/riveter/attributes.rb', line 312

def default
  @default ||= options[:default]
end

#default?Boolean

Returns:

  • (Boolean)


316
317
318
# File 'lib/riveter/attributes.rb', line 316

def default?
  !self.default.nil?
end

#required?Boolean

Returns:

  • (Boolean)


308
309
310
# File 'lib/riveter/attributes.rb', line 308

def required?
  @required ||= (options[:required] == true)
end