Class: Bundler::GemBytes::Actions::Gemspec::Attribute
- Inherits:
-
Struct
- Object
- Struct
- Bundler::GemBytes::Actions::Gemspec::Attribute
- Defined in:
- lib/bundler/gem_bytes/actions/gemspec/attribute.rb
Overview
Holds the components of a attribute: a name and a value
Attributes in the gemspec look like the following:
“‘ruby Gem::Specification.new do |spec|
spec.name = 'test'
end “‘
Instance Attribute Summary collapse
-
#name ⇒ String
readonly
The name of the attribute.
-
#value ⇒ Parser::AST::Node
readonly
The value of the attribute expressed as an AST tree.
Instance Method Summary collapse
-
#to_a ⇒ Array
Converts the attribute into an array.
Instance Attribute Details
#name ⇒ String (readonly)
The name of the attribute
45 46 47 |
# File 'lib/bundler/gem_bytes/actions/gemspec/attribute.rb', line 45 Attribute = Struct.new(:name, :value) do def to_a = [name, value.to_sexp_array] end |
#value ⇒ Parser::AST::Node (readonly)
The value of the attribute expressed as an AST tree
45 46 47 |
# File 'lib/bundler/gem_bytes/actions/gemspec/attribute.rb', line 45 Attribute = Struct.new(:name, :value) do def to_a = [name, value.to_sexp_array] end |
Instance Method Details
#to_a ⇒ Array
Converts the attribute into an array
45 46 47 |
# File 'lib/bundler/gem_bytes/actions/gemspec/attribute.rb', line 45 Attribute = Struct.new(:name, :value) do def to_a = [name, value.to_sexp_array] end |