Class: Modern::DSL::Info
- Inherits:
-
Object
- Object
- Modern::DSL::Info
- Defined in:
- lib/modern/dsl/info.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Class Method Summary collapse
Instance Method Summary collapse
- #contact(name: nil, url: nil, email: nil) ⇒ Object
- #description(v) ⇒ Object
-
#initialize(title, version) ⇒ Info
constructor
A new instance of Info.
- #license(name, url: nil) ⇒ Object
- #terms_of_service(v) ⇒ Object
Constructor Details
#initialize(title, version) ⇒ Info
Returns a new instance of Info.
12 13 14 |
# File 'lib/modern/dsl/info.rb', line 12 def initialize(title, version) @value = Modern::Descriptor::Info.new(title: title, version: version) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
10 11 12 |
# File 'lib/modern/dsl/info.rb', line 10 def value @value end |
Class Method Details
Instance Method Details
#contact(name: nil, url: nil, email: nil) ⇒ Object
24 25 26 |
# File 'lib/modern/dsl/info.rb', line 24 def contact(name: nil, url: nil, email: nil) @value = @value.copy(contact: { name: name, url: url, email: email }.compact) end |
#description(v) ⇒ Object
16 17 18 |
# File 'lib/modern/dsl/info.rb', line 16 def description(v) @value = @value.copy(description: v) end |
#license(name, url: nil) ⇒ Object
28 29 30 |
# File 'lib/modern/dsl/info.rb', line 28 def license(name, url: nil) @value = @value.copy(license: { name: name, url: url }.compact) end |
#terms_of_service(v) ⇒ Object
20 21 22 |
# File 'lib/modern/dsl/info.rb', line 20 def terms_of_service(v) @value = @value.copy(terms_of_service: v) end |