Class: Card::Set::RequiredField
- Inherits:
-
Object
- Object
- Card::Set::RequiredField
- Defined in:
- lib/card/set/required_field.rb
Instance Attribute Summary collapse
-
#field ⇒ Object
readonly
Returns the value of attribute field.
-
#field_set ⇒ Object
readonly
Returns the value of attribute field_set.
-
#parent_set ⇒ Object
readonly
Returns the value of attribute parent_set.
Instance Method Summary collapse
- #add ⇒ Object
- #field_event_name(action) ⇒ Object
-
#initialize(parent_set, field) ⇒ RequiredField
constructor
A new instance of RequiredField.
- #parent_event_name ⇒ Object
Constructor Details
#initialize(parent_set, field) ⇒ RequiredField
Returns a new instance of RequiredField.
6 7 8 9 10 |
# File 'lib/card/set/required_field.rb', line 6 def initialize parent_set, field @parent_set = parent_set @field_set = ensure_field_set parent_set, field @field = field end |
Instance Attribute Details
#field ⇒ Object (readonly)
Returns the value of attribute field.
4 5 6 |
# File 'lib/card/set/required_field.rb', line 4 def field @field end |
#field_set ⇒ Object (readonly)
Returns the value of attribute field_set.
4 5 6 |
# File 'lib/card/set/required_field.rb', line 4 def field_set @field_set end |
#parent_set ⇒ Object (readonly)
Returns the value of attribute parent_set.
4 5 6 |
# File 'lib/card/set/required_field.rb', line 4 def parent_set @parent_set end |
Instance Method Details
#add ⇒ Object
12 13 14 15 |
# File 'lib/card/set/required_field.rb', line 12 def add create_parent_event create_field_events end |
#field_event_name(action) ⇒ Object
21 22 23 |
# File 'lib/card/set/required_field.rb', line 21 def field_event_name action [field_set.underscore, "required_by", parent_set.underscore, "on", action].join("__").to_sym end |
#parent_event_name ⇒ Object
17 18 19 |
# File 'lib/card/set/required_field.rb', line 17 def parent_event_name [parent_set.underscore, "requires_field", field_set.underscore].join("__").to_sym end |