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.



115
116
117
# File 'lib/transpec/syntax/its.rb', line 115

def initialize(node)
  @node = node
end

Instance Attribute Details

#node ⇒ Object (readonly)

Returns the value of attribute node.



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

def node
  @node
end

Instance Method Details

#attributes ⇒ Object



127
128
129
130
131
132
133
# File 'lib/transpec/syntax/its.rb', line 127

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

#brackets? ⇒ Boolean

Returns:

  • (Boolean)


119
120
121
# File 'lib/transpec/syntax/its.rb', line 119

def brackets?
  node.array_type?
end

#literal? ⇒ Boolean

Returns:

  • (Boolean)


123
124
125
# File 'lib/transpec/syntax/its.rb', line 123

def literal?
  Util.literal?(node)
end