Class: RbsActiverecord::Generator::PluckOverloads
- Inherits:
-
Object
- Object
- RbsActiverecord::Generator::PluckOverloads
- Includes:
- Utils
- Defined in:
- lib/rbs_activerecord/generator/pluck_overloads.rb
Instance Attribute Summary collapse
-
#model ⇒ Object
readonly
: RbsActiverecord::Model.
Instance Method Summary collapse
-
#generate ⇒ Object
: String.
-
#initialize(model) ⇒ PluckOverloads
constructor
A new instance of PluckOverloads.
Methods included from Utils
#format, #klass_to_names, #primary_key_type_for, #sql_type_to_class
Constructor Details
#initialize(model) ⇒ PluckOverloads
Returns a new instance of PluckOverloads.
11 12 13 |
# File 'lib/rbs_activerecord/generator/pluck_overloads.rb', line 11 def initialize(model) #: void @model = model end |
Instance Attribute Details
#model ⇒ Object (readonly)
: RbsActiverecord::Model
8 9 10 |
# File 'lib/rbs_activerecord/generator/pluck_overloads.rb', line 8 def model @model end |
Instance Method Details
#generate ⇒ Object
: String
15 16 17 18 19 20 21 22 23 |
# File 'lib/rbs_activerecord/generator/pluck_overloads.rb', line 15 def generate #: String <<~RBS.strip module GeneratedPluckOverloads def pluck: #{overloads.join(" | ")} | (::Symbol | ::String | ::Arel::Nodes::t column) -> ::Array[untyped] | (*::Symbol | ::String | ::Arel::Nodes::t columns) -> ::Array[::Array[untyped]] end RBS end |