Class: PureForm::Attribute

Inherits:
Object
  • Object
show all
Defined in:
lib/pure_form/attribute.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(context, name, options) ⇒ Attribute

Returns a new instance of Attribute.



5
6
7
8
# File 'lib/pure_form/attribute.rb', line 5

def initialize(context, name, options)
  @context, @name, @options = context, name.to_s, options
  @value_type = build_value_type
end

Instance Attribute Details

#contextObject (readonly)

Returns the value of attribute context.



3
4
5
# File 'lib/pure_form/attribute.rb', line 3

def context
  @context
end

#nameObject (readonly)

Returns the value of attribute name.



3
4
5
# File 'lib/pure_form/attribute.rb', line 3

def name
  @name
end

#optionsObject (readonly)

Returns the value of attribute options.



3
4
5
# File 'lib/pure_form/attribute.rb', line 3

def options
  @options
end

#value_typeObject (readonly)

Returns the value of attribute value_type.



3
4
5
# File 'lib/pure_form/attribute.rb', line 3

def value_type
  @value_type
end

Instance Method Details

#defineObject



10
11
12
13
14
15
# File 'lib/pure_form/attribute.rb', line 10

def define
  define_setter
  define_complex_setter
  define_getter
  define_predicate
end