Class: Rails::Generators::AppBase::GemfileEntry

Inherits:
Struct show all
Defined in:
railties/lib/rails/generators/app_base.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Struct

#as_json

Constructor Details

#initialize(name, version, comment, options = {}, commented_out = false) ⇒ GemfileEntry

Returns a new instance of GemfileEntry.



246
247
248
# File 'railties/lib/rails/generators/app_base.rb', line 246

def initialize(name, version, comment, options = {}, commented_out = false)
  super
end

Instance Attribute Details

#versionObject

Returns the value of attribute version

Returns:

  • (Object)

    the current value of version



245
246
247
# File 'railties/lib/rails/generators/app_base.rb', line 245

def version
  @version
end

Class Method Details

.github(name, github, branch = nil, comment = nil) ⇒ Object



250
251
252
253
254
255
256
# File 'railties/lib/rails/generators/app_base.rb', line 250

def self.github(name, github, branch = nil, comment = nil)
  if branch
    new(name, nil, comment, github: github, branch: branch)
  else
    new(name, nil, comment, github: github)
  end
end

.path(name, path, comment = nil) ⇒ Object



262
263
264
# File 'railties/lib/rails/generators/app_base.rb', line 262

def self.path(name, path, comment = nil)
  new(name, nil, comment, path: path)
end

.version(name, version, comment = nil) ⇒ Object



258
259
260
# File 'railties/lib/rails/generators/app_base.rb', line 258

def self.version(name, version, comment = nil)
  new(name, version, comment)
end