Class: Scopiform::ScopeDefinition
- Inherits:
-
Object
- Object
- Scopiform::ScopeDefinition
- Defined in:
- lib/scopiform/scope_definition.rb
Instance Attribute Summary collapse
-
#attribute ⇒ Object
Returns the value of attribute attribute.
-
#options ⇒ Object
Returns the value of attribute options.
-
#prefix ⇒ Object
Returns the value of attribute prefix.
-
#suffix ⇒ Object
Returns the value of attribute suffix.
Instance Method Summary collapse
- #dup ⇒ Object
-
#initialize(attribute, prefix: nil, suffix: nil, **options) ⇒ ScopeDefinition
constructor
A new instance of ScopeDefinition.
- #name ⇒ Object
- #name_for(attribute_name) ⇒ Object
Constructor Details
#initialize(attribute, prefix: nil, suffix: nil, **options) ⇒ ScopeDefinition
Returns a new instance of ScopeDefinition.
5 6 7 8 9 10 |
# File 'lib/scopiform/scope_definition.rb', line 5 def initialize(attribute, prefix: nil, suffix: nil, **) @attribute = attribute.to_sym @prefix = prefix @suffix = suffix @options = end |
Instance Attribute Details
#attribute ⇒ Object
Returns the value of attribute attribute.
3 4 5 |
# File 'lib/scopiform/scope_definition.rb', line 3 def attribute @attribute end |
#options ⇒ Object
Returns the value of attribute options.
3 4 5 |
# File 'lib/scopiform/scope_definition.rb', line 3 def @options end |
#prefix ⇒ Object
Returns the value of attribute prefix.
3 4 5 |
# File 'lib/scopiform/scope_definition.rb', line 3 def prefix @prefix end |
#suffix ⇒ Object
Returns the value of attribute suffix.
3 4 5 |
# File 'lib/scopiform/scope_definition.rb', line 3 def suffix @suffix end |
Instance Method Details
#dup ⇒ Object
20 21 22 23 24 25 |
# File 'lib/scopiform/scope_definition.rb', line 20 def dup duplicate = super duplicate. = .dup duplicate end |
#name ⇒ Object
12 13 14 |
# File 'lib/scopiform/scope_definition.rb', line 12 def name name_for(attribute) end |
#name_for(attribute_name) ⇒ Object
16 17 18 |
# File 'lib/scopiform/scope_definition.rb', line 16 def name_for(attribute_name) "#{prefix}#{attribute_name}#{suffix}".underscore.to_sym end |