Class: Npm::Rails::Package

Inherits:
Object
  • Object
show all
Defined in:
lib/npm/rails/package.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, version, options = {}) ⇒ Package

Returns a new instance of Package.



9
10
11
12
13
14
15
# File 'lib/npm/rails/package.rb', line 9

def initialize(name, version, options = {})
  @name = name
  @version = version
  @development = options.fetch(:development, false)
  @build_name = options.fetch(:build_name, create_build_name_from_name)
  @require = options.fetch(:require, true)
end

Instance Attribute Details

#build_nameObject (readonly)

Returns the value of attribute build_name.



7
8
9
# File 'lib/npm/rails/package.rb', line 7

def build_name
  @build_name
end

#nameObject (readonly)

Returns the value of attribute name.



5
6
7
# File 'lib/npm/rails/package.rb', line 5

def name
  @name
end

#versionObject (readonly)

Returns the value of attribute version.



6
7
8
# File 'lib/npm/rails/package.rb', line 6

def version
  @version
end

Instance Method Details

#development?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/npm/rails/package.rb', line 17

def development?
  @development
end

#should_require?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/npm/rails/package.rb', line 21

def should_require?
  @require
end