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

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

Instance Method Summary collapse

Constructor Details

#initialize(node) ⇒ AttributeExpression

Returns a new instance of AttributeExpression.



109
110
111
# File 'lib/transpec/syntax/its.rb', line 109

def initialize(node)
  @node = node
end

Instance Method Details

#attributesObject



121
122
123
124
125
126
127
# File 'lib/transpec/syntax/its.rb', line 121

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

#brackets?Boolean

Returns:

  • (Boolean)


113
114
115
# File 'lib/transpec/syntax/its.rb', line 113

def brackets?
  @node.type == :array
end

#literal?Boolean

Returns:

  • (Boolean)


117
118
119
# File 'lib/transpec/syntax/its.rb', line 117

def literal?
  Util.literal?(@node)
end