Class: ActiveMocker::ActiveRecord::Field Private
- Inherits:
-
Object
- Object
- ActiveMocker::ActiveRecord::Field
- Defined in:
- lib/active_mocker/active_record/field.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Attribute Summary collapse
- #name ⇒ Object private
- #options ⇒ Object private
- #type ⇒ Object private
Instance Method Summary collapse
- #default ⇒ Object private
-
#initialize(name, type, options) ⇒ Field
constructor
private
A new instance of Field.
- #precision ⇒ Object private
- #primary_key ⇒ Object private
- #scale ⇒ Object private
- #to_h ⇒ Object (also: #to_hash) private
Constructor Details
#initialize(name, type, options) ⇒ Field
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Field.
8 9 10 11 12 13 |
# File 'lib/active_mocker/active_record/field.rb', line 8 def initialize(name, type, ) @name = name @type = type @primary_key @options = .first || {} end |
Instance Attribute Details
#name ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
6 7 8 |
# File 'lib/active_mocker/active_record/field.rb', line 6 def name @name end |
#options ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
6 7 8 |
# File 'lib/active_mocker/active_record/field.rb', line 6 def @options end |
#type ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
6 7 8 |
# File 'lib/active_mocker/active_record/field.rb', line 6 def type @type end |
Instance Method Details
#default ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
25 26 27 |
# File 'lib/active_mocker/active_record/field.rb', line 25 def default [:default] end |
#precision ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
29 30 31 |
# File 'lib/active_mocker/active_record/field.rb', line 29 def precision [:precision] end |
#primary_key ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
15 16 17 |
# File 'lib/active_mocker/active_record/field.rb', line 15 def primary_key @primary_key end |
#scale ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
33 34 35 |
# File 'lib/active_mocker/active_record/field.rb', line 33 def scale [:scale] end |
#to_h ⇒ Object Also known as: to_hash
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
19 20 21 |
# File 'lib/active_mocker/active_record/field.rb', line 19 def to_h {name: name, type: type, options: } end |