Class: AutoC::STD::Primitive
- Includes:
- Entity
- Defined in:
- lib/autoc/std.rb
Overview
Base class for a more elaborate primitive type directly includable into the module as a dependency
Direct Known Subclasses
Constant Summary collapse
- @@types =
::Set.new
Constants included from Entity
Instance Attribute Summary collapse
-
#matcher ⇒ Object
readonly
Returns the value of attribute matcher.
Attributes inherited from Type
Class Method Summary collapse
Instance Method Summary collapse
- #const_lvalue ⇒ Object
- #const_rvalue ⇒ Object
-
#initialize(type, matcher: Regexp.new("^#{type}$"), header: nil) ⇒ Primitive
constructor
A new instance of Primitive.
- #lvalue ⇒ Object
- #rvalue ⇒ Object
- #to_value ⇒ Object
Methods included from Entity
#<=>, #complexity, #dependencies, #forward_declarations, #implementation, #interface, #position, #references, #total_dependencies, #total_references
Methods inherited from Primitive
#compare, #copy, #custom_create, #default_create, #equal, #hash_code
Methods inherited from Type
abstract, #comparable?, #constructible?, #copy, #copyable?, #custom_constructible?, #custom_create, #default_constructible?, #default_create, #destroy, #destructible?, #hashable?, #inspect, #orderable?, #to_s, #to_type
Constructor Details
#initialize(type, matcher: Regexp.new("^#{type}$"), header: nil) ⇒ Primitive
Returns a new instance of Primitive.
43 44 45 46 47 48 |
# File 'lib/autoc/std.rb', line 43 def initialize(type, matcher: Regexp.new("^#{type}$"), header: nil) super(type) @matcher = matcher dependencies << header unless header.nil? @@types << self end |
Instance Attribute Details
#matcher ⇒ Object (readonly)
Returns the value of attribute matcher.
41 42 43 |
# File 'lib/autoc/std.rb', line 41 def matcher @matcher end |
Class Method Details
Instance Method Details
#const_lvalue ⇒ Object
58 |
# File 'lib/autoc/std.rb', line 58 def const_lvalue = @clv ||= AutoC::Value.new(self, constant: true, reference: true) |
#const_rvalue ⇒ Object
56 |
# File 'lib/autoc/std.rb', line 56 def const_rvalue = @crv ||= AutoC::Value.new(self, constant: true) |
#lvalue ⇒ Object
54 |
# File 'lib/autoc/std.rb', line 54 def lvalue = @lv ||= AutoC::Value.new(self, reference: true) |
#to_value ⇒ Object
50 |
# File 'lib/autoc/std.rb', line 50 def to_value = rvalue |