Class: Transpec::Syntax::Its::AttributeExpression
- Inherits:
-
Object
- Object
- Transpec::Syntax::Its::AttributeExpression
- Defined in:
- lib/transpec/syntax/its.rb
Instance Attribute Summary collapse
-
#node ⇒ Object
readonly
Returns the value of attribute node.
Instance Method Summary collapse
- #attributes ⇒ Object
- #brackets? ⇒ Boolean
-
#initialize(node) ⇒ AttributeExpression
constructor
A new instance of AttributeExpression.
- #literal? ⇒ Boolean
Constructor Details
#initialize(node) ⇒ AttributeExpression
Returns a new instance of AttributeExpression.
119 120 121 |
# File 'lib/transpec/syntax/its.rb', line 119 def initialize(node) @node = node end |
Instance Attribute Details
#node ⇒ Object (readonly)
Returns the value of attribute node.
117 118 119 |
# File 'lib/transpec/syntax/its.rb', line 117 def node @node end |
Instance Method Details
#attributes ⇒ Object
131 132 133 134 135 136 137 |
# File 'lib/transpec/syntax/its.rb', line 131 def attributes @attributes ||= if brackets? brackets_attributes else non_brackets_attributes end end |
#brackets? ⇒ Boolean
123 124 125 |
# File 'lib/transpec/syntax/its.rb', line 123 def brackets? node.array_type? end |
#literal? ⇒ Boolean
127 128 129 |
# File 'lib/transpec/syntax/its.rb', line 127 def literal? Util.literal?(node) end |