class ConstructorIORails::Fields

Attributes

set[RW]

Public Class Methods

new() click to toggle source
# File lib/constructorio-rails/fields.rb, line 9
def initialize
  @set = {}
end

Public Instance Methods

add(model_name, field) click to toggle source
# File lib/constructorio-rails/fields.rb, line 13
def add(model_name, field)
  @set[model_name] ||= {}
  @set[model_name][field] = 1
end
list(model_name) click to toggle source
# File lib/constructorio-rails/fields.rb, line 18
def list(model_name)
  if @set[model_name].is_a?(Hash)
    @set[model_name].keys
  else
    []
  end
end