Class: Dms::StringForm
- Inherits:
-
Object
- Object
- Dms::StringForm
- Defined in:
- lib/dms/types.rb
Instance Attribute Summary collapse
-
#flavor ⇒ Object
readonly
Returns the value of attribute flavor.
-
#kind ⇒ Object
readonly
Returns the value of attribute kind.
-
#label ⇒ Object
readonly
Returns the value of attribute label.
-
#modifiers ⇒ Object
readonly
Returns the value of attribute modifiers.
Class Method Summary collapse
Instance Method Summary collapse
- #==(o) ⇒ Object (also: #eql?)
- #hash ⇒ Object
-
#initialize(kind, flavor: nil, label: nil, modifiers: nil) ⇒ StringForm
constructor
A new instance of StringForm.
Constructor Details
#initialize(kind, flavor: nil, label: nil, modifiers: nil) ⇒ StringForm
Returns a new instance of StringForm.
91 92 93 |
# File 'lib/dms/types.rb', line 91 def initialize(kind, flavor: nil, label: nil, modifiers: nil) @kind = kind; @flavor = flavor; @label = label; @modifiers = modifiers end |
Instance Attribute Details
#flavor ⇒ Object (readonly)
Returns the value of attribute flavor.
90 91 92 |
# File 'lib/dms/types.rb', line 90 def flavor @flavor end |
#kind ⇒ Object (readonly)
Returns the value of attribute kind.
90 91 92 |
# File 'lib/dms/types.rb', line 90 def kind @kind end |
#label ⇒ Object (readonly)
Returns the value of attribute label.
90 91 92 |
# File 'lib/dms/types.rb', line 90 def label @label end |
#modifiers ⇒ Object (readonly)
Returns the value of attribute modifiers.
90 91 92 |
# File 'lib/dms/types.rb', line 90 def modifiers @modifiers end |
Class Method Details
.basic ⇒ Object
94 |
# File 'lib/dms/types.rb', line 94 def self.basic; new(:basic); end |
.heredoc(flavor, label, modifiers) ⇒ Object
96 97 98 |
# File 'lib/dms/types.rb', line 96 def self.heredoc(flavor, label, modifiers) new(:heredoc, flavor: flavor, label: label, modifiers: modifiers.to_a) end |
.literal ⇒ Object
95 |
# File 'lib/dms/types.rb', line 95 def self.literal; new(:literal); end |
Instance Method Details
#==(o) ⇒ Object Also known as: eql?
99 100 101 102 |
# File 'lib/dms/types.rb', line 99 def ==(o) o.is_a?(StringForm) && @kind == o.kind && @flavor == o.flavor && @label == o.label && @modifiers == o.modifiers end |
#hash ⇒ Object
104 |
# File 'lib/dms/types.rb', line 104 def hash; [StringForm, @kind, @flavor, @label, @modifiers].hash; end |