Class: Chelsy::Constant::String

Inherits:
Base show all
Defined in:
lib/chelsy/ast.rb

Instance Attribute Summary collapse

Attributes inherited from Element

#fragments, #post_fragments

Instance Method Summary collapse

Constructor Details

#initialize(str, wide: false, **rest) ⇒ String

Returns a new instance of String.



522
523
524
525
526
527
# File 'lib/chelsy/ast.rb', line 522

def initialize(str, wide: false, **rest)
  @value = Chelsy.immutable_stringify(str)
  @wide = !!wide

  super(**rest)
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



520
521
522
# File 'lib/chelsy/ast.rb', line 520

def value
  @value
end

Instance Method Details

#wide?Boolean

Returns:

  • (Boolean)


529
530
531
# File 'lib/chelsy/ast.rb', line 529

def wide?
  @wide
end