Class: Pray::Literal::LiteralValue
- Inherits:
-
Struct
- Object
- Struct
- Pray::Literal::LiteralValue
- Defined in:
- lib/pray/literal.rb
Instance Attribute Summary collapse
-
#kind ⇒ Object
Returns the value of attribute kind.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
- #as_array ⇒ Object
- #as_bool ⇒ Object
- #as_integer ⇒ Object
- #as_map ⇒ Object
- #as_string ⇒ Object
- #string? ⇒ Boolean
Instance Attribute Details
#kind ⇒ Object
Returns the value of attribute kind
5 6 7 |
# File 'lib/pray/literal.rb', line 5 def kind @kind end |
#value ⇒ Object
Returns the value of attribute value
5 6 7 |
# File 'lib/pray/literal.rb', line 5 def value @value end |
Instance Method Details
#as_array ⇒ Object
10 |
# File 'lib/pray/literal.rb', line 10 def as_array = (kind == :array) ? value : nil |
#as_bool ⇒ Object
8 |
# File 'lib/pray/literal.rb', line 8 def as_bool = (kind == :bool) ? value : nil |
#as_integer ⇒ Object
9 |
# File 'lib/pray/literal.rb', line 9 def as_integer = (kind == :integer) ? value : nil |
#as_map ⇒ Object
11 |
# File 'lib/pray/literal.rb', line 11 def as_map = (kind == :map) ? value : nil |
#as_string ⇒ Object
7 |
# File 'lib/pray/literal.rb', line 7 def as_string = string? ? value : nil |
#string? ⇒ Boolean
6 |
# File 'lib/pray/literal.rb', line 6 def string? = kind == :string || kind == :symbol |