Class: Arfy::MigrationBuilder::Option
- Inherits:
-
Object
- Object
- Arfy::MigrationBuilder::Option
- Defined in:
- lib/arfy/migration_builder/builders/column.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(name, value = nil) ⇒ Option
constructor
A new instance of Option.
- #value_string ⇒ Object
Constructor Details
#initialize(name, value = nil) ⇒ Option
Returns a new instance of Option.
48 49 50 51 52 |
# File 'lib/arfy/migration_builder/builders/column.rb', line 48 def initialize(name, value=nil) super @name = name @value = value end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
47 48 49 |
# File 'lib/arfy/migration_builder/builders/column.rb', line 47 def name @name end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
47 48 49 |
# File 'lib/arfy/migration_builder/builders/column.rb', line 47 def value @value end |
Instance Method Details
#value_string ⇒ Object
54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/arfy/migration_builder/builders/column.rb', line 54 def value_string value_string = "" if @value.class == String value_string = "\"#{@value}\"" elsif @value.class == Symbol value_string = ":#{@value}" else value_string = @value.to_s end value_string end |