Class: C::Literal
- Inherits:
-
Object
- Object
- C::Literal
- Defined in:
- lib/csquare.rb
Instance Method Summary collapse
- #csquare_key ⇒ Object
- #depth ⇒ Object
- #involves?(literal_or_variables) ⇒ Boolean
- #return_typename(function, blueprint) ⇒ Object
- #underlying_value ⇒ Object
Instance Method Details
#csquare_key ⇒ Object
605 606 607 |
# File 'lib/csquare.rb', line 605 def csquare_key self.val end |
#depth ⇒ Object
601 602 603 |
# File 'lib/csquare.rb', line 601 def depth 0 end |
#involves?(literal_or_variables) ⇒ Boolean
586 587 588 |
# File 'lib/csquare.rb', line 586 def involves? literal_or_variables literal_or_variables.is_a?(Array) ? literal_or_variables.include?(self.val) : literal_or_variables == self.val end |
#return_typename(function, blueprint) ⇒ Object
594 595 596 597 598 599 |
# File 'lib/csquare.rb', line 594 def return_typename function, blueprint return :integer if val.is_a?(Fixnum) return :float if val.is_a?(Float) return :string if val.is_a?(String) raise(NotImplementedError, "unhandled literal type: #{self.inspect}") end |
#underlying_value ⇒ Object
590 591 592 |
# File 'lib/csquare.rb', line 590 def self.val end |