Class: SampleModels::Sampler::ConfigureRecipient::Attribute

Inherits:
Object
  • Object
show all
Defined in:
lib/sample_models/sampler.rb

Instance Method Summary collapse

Constructor Details

#initialize(sampler, attribute) ⇒ Attribute

Returns a new instance of Attribute.



83
84
85
# File 'lib/sample_models/sampler.rb', line 83

def initialize(sampler, attribute)
  @sampler, @attribute = sampler, attribute
end

Instance Method Details

#default(default) ⇒ Object



87
88
89
# File 'lib/sample_models/sampler.rb', line 87

def default(default)
  @sampler.defaults[@attribute] = default
end

#default_class(dc) ⇒ Object



91
92
93
# File 'lib/sample_models/sampler.rb', line 91

def default_class(dc)
  @sampler.polymorphic_default_classes[@attribute] = dc
end

#force_email_formatObject



95
96
97
# File 'lib/sample_models/sampler.rb', line 95

def force_email_format
  @sampler.force_email_format(@attribute)
end

#force_uniqueObject



99
100
101
# File 'lib/sample_models/sampler.rb', line 99

def force_unique
  @sampler.force_unique(@attribute)
end