Class: Ez::Resources::Manager::Fields

Inherits:
Object
  • Object
show all
Defined in:
lib/ez/resources/manager/fields.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(&block) ⇒ Fields

Returns a new instance of Fields.



12
13
14
15
16
17
# File 'lib/ez/resources/manager/fields.rb', line 12

def initialize(&block)
  @fields  = []
  @actions = []

  instance_eval(&block)
end

Instance Attribute Details

#actionsObject (readonly)

Returns the value of attribute actions.



10
11
12
# File 'lib/ez/resources/manager/fields.rb', line 10

def actions
  @actions
end

#fieldsObject (readonly)

Returns the value of attribute fields.



10
11
12
# File 'lib/ez/resources/manager/fields.rb', line 10

def fields
  @fields
end

Instance Method Details

#action(name, builder, options = {}) ⇒ Object



25
26
27
# File 'lib/ez/resources/manager/fields.rb', line 25

def action(name, builder, options = {})
  @actions << Action.new(name, builder, **options)
end

#field(name, options = {}) ⇒ Object Also known as: column



19
20
21
# File 'lib/ez/resources/manager/fields.rb', line 19

def field(name, options = {})
  @fields << Field.new(name: name, **options)
end