Class: Transpec::Syntax::Its::AttributeExpression

Inherits:
Object
  • Object
show all
Defined in:
lib/transpec/syntax/its.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(node) ⇒ AttributeExpression

Returns a new instance of AttributeExpression.



129
130
131
# File 'lib/transpec/syntax/its.rb', line 129

def initialize(node)
  @node = node
end

Instance Attribute Details

#nodeObject (readonly)

Returns the value of attribute node.



127
128
129
# File 'lib/transpec/syntax/its.rb', line 127

def node
  @node
end

Instance Method Details

#attributesObject



141
142
143
144
145
146
147
# File 'lib/transpec/syntax/its.rb', line 141

def attributes
  @attributes ||= if brackets?
                    brackets_attributes
                  else
                    non_brackets_attributes
                  end
end

#brackets?Boolean

Returns:

  • (Boolean)


133
134
135
# File 'lib/transpec/syntax/its.rb', line 133

def brackets?
  node.array_type?
end

#literal?Boolean

Returns:

  • (Boolean)


137
138
139
# File 'lib/transpec/syntax/its.rb', line 137

def literal?
  Util.literal?(node)
end